[master] 3e66986 If the acceptor thread can hand work off to other threads, release any VCL reference it might have, in order to not hold on to discarded VCLs forever.

Poul-Henning Kamp phk at varnish-cache.org
Mon Oct 22 09:08:05 CEST 2012


commit 3e66986396418558d70194196813d9526b54f3f0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 22 07:07:27 2012 +0000

    If the acceptor thread can hand work off to other threads, release any
    VCL reference it might have, in order to not hold on to discarded VCLs
    forever.

diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 336c76a..0e0d9dd 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -163,6 +163,13 @@ pool_accept(struct worker *wrk, void *arg)
 		wrk2->task.func = SES_pool_accept_task;
 		wrk2->task.priv = pp->sesspool;
 		AZ(pthread_cond_signal(&wrk2->cond));
+
+		/*
+		 * We were able to hand off, so release this threads VCL
+		 * reference (if any) so we don't hold on to discarded VCLs.
+		 */
+		if (wrk->vcl != NULL)
+			VCL_Rel(&wrk->vcl);
 	}
 }
 



More information about the varnish-commit mailing list