[3.0] b793875 Make HSH_Deref return the busyobj to the worker for reuse when dereferencing and destroying a busy objcore.
Tollef Fog Heen
tfheen at varnish-cache.org
Wed Aug 17 11:26:34 CEST 2011
commit b7938755176d48f1b6e309025397de00f02a6389
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Tue Aug 2 23:04:14 2011 +0200
Make HSH_Deref return the busyobj to the worker for reuse when
dereferencing and destroying a busy objcore.
Free the busyobj in the case that the worker already has one
(potential race condition from the expiry/ban-lurker threads?)
diff --git a/bin/varnishd/cache_hash.c b/bin/varnishd/cache_hash.c
index 92ee92f..0ca8766 100644
--- a/bin/varnishd/cache_hash.c
+++ b/bin/varnishd/cache_hash.c
@@ -718,6 +718,16 @@ HSH_Deref(struct worker *w, struct objcore *oc, struct object **oo)
BAN_DestroyObj(oc);
AZ(oc->ban);
+ if (oc->flags & OC_F_BUSY) {
+ CHECK_OBJ_NOTNULL(oc->busyobj, BUSYOBJ_MAGIC);
+ if (w->nbusyobj == NULL)
+ w->nbusyobj = oc->busyobj;
+ else
+ FREE_OBJ(oc->busyobj);
+ oc->busyobj = NULL;
+ }
+ AZ(oc->busyobj);
+
if (oc->methods != NULL) {
oc_freeobj(oc);
w->stats.n_object--;
More information about the varnish-commit
mailing list