[3.0] a71c7de Make the ban lurker skip busy objects
Martin Blix Grydeland
martin at varnish-cache.org
Thu Jul 19 10:41:28 CEST 2012
commit a71c7de8a15452368de76c384c7d26c5b775bb79
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_ban.c b/bin/varnishd/cache_ban.c
index bab278d..5c1da57 100644
--- a/bin/varnishd/cache_ban.c
+++ b/bin/varnishd/cache_ban.c
@@ -838,6 +838,18 @@ ban_lurker_work(const struct sess *sp, 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