[master] 0c9975c Make the ban lurker skip busy objects
Martin Blix Grydeland
martin at varnish-cache.org
Thu Jul 19 10:37:29 CEST 2012
commit 0c9975c1be926799c368d904dd65204eca25ed50
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Wed Jul 4 13:02:55 2012 +0200
Make the ban lurker skip busy objects
If the ban lurker finds a busy object, skip the object and defer the
checking to a later pass.
No test case because it is very timing sensitive (but see the trac bug
report for a VTC-file that mostly triggers it on the 3.0 branch only)
Fixes: #1162
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index be8af1a..4164e4b 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -879,6 +879,18 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
continue;
}
/*
+ * If the object is busy, we can't touch
+ * it. Defer it to a later run.
+ */
+ if (oc->flags & OC_F_BUSY) {
+ oc->flags |= pass;
+ VTAILQ_REMOVE(&b->objcore, oc, ban_list);
+ VTAILQ_INSERT_TAIL(&b->objcore, oc, ban_list);
+ Lck_Unlock(&oh->mtx);
+ Lck_Unlock(&ban_mtx);
+ continue;
+ }
+ /*
* Grab a reference to the OC and we can let go of
* the BAN mutex
*/
More information about the varnish-commit
mailing list