r1913 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 21 11:23:32 CEST 2007


Author: phk
Date: 2007-08-21 11:23:31 +0200 (Tue, 21 Aug 2007)
New Revision: 1913

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Make sure wrk->used is always set when we park on an object, we might be
unlucky multiple times in which case the responsibility falls back to
cnt_lookup().

Fixes 144.





Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2007-08-20 21:11:15 UTC (rev 1912)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2007-08-21 09:23:31 UTC (rev 1913)
@@ -524,7 +524,12 @@
 		 */
 		WSL(sp->wrk, SLT_Debug, sp->fd,
 		    "on waiting list on obj %u", sp->obj->xid);
-		assert(!isnan(sp->wrk->used));
+		/*
+		 * There is a non-zero risk that we come here more than once
+		 * before we get through, in that case cnt_recv must be set
+		 */
+		if (isnan(sp->wrk->used))
+			sp->wrk->used = TIM_real();
 		SES_Charge(sp);
 		return (1);
 	}




More information about the varnish-commit mailing list