r3325 - in branches/2.0/varnish-cache/bin: varnishd varnishtest/tests

tfheen at projects.linpro.no tfheen at projects.linpro.no
Mon Oct 20 10:55:24 CEST 2008


Author: tfheen
Date: 2008-10-20 10:55:24 +0200 (Mon, 20 Oct 2008)
New Revision: 3325

Added:
   branches/2.0/varnish-cache/bin/varnishtest/tests/r00345.vtc
Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
   branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
Merge r3322 from trunk

Modified: branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2008-10-18 20:50:10 UTC (rev 3324)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2008-10-20 08:55:24 UTC (rev 3325)
@@ -266,7 +266,8 @@
 
 	if (busy_o != NULL) {
 		/* There are one or more busy objects, wait for them */
-		VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list);
+		if (sp->esis == 0)
+			VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list);
 		sp->objhead = oh;
 		UNLOCK(&oh->mtx);
 		return (NULL);

Modified: branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c	2008-10-18 20:50:10 UTC (rev 3324)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c	2008-10-20 08:55:24 UTC (rev 3325)
@@ -796,7 +796,6 @@
 void
 ESI_Deliver(struct sess *sp)
 {
-
 	struct esi_bit *eb;
 	struct object *obj;
 
@@ -839,7 +838,16 @@
 		sp->step = STP_RECV;
 		http_ForceGet(sp->http);
 		http_Unset(sp->http, H_Content_Length);
-		CNT_Session(sp);
+		while (1) {
+			CNT_Session(sp);
+			if (sp->step == STP_DONE)
+				break;
+			AN(sp->wrk);
+			WSL_Flush(sp->wrk, 0);
+			DSL(0x20, SLT_Debug, sp->id, "loop waiting for ESI");
+			usleep(10000);
+		}
+		assert(sp->step == STP_DONE);
 		sp->esis--;
 		sp->obj = obj;
 

Copied: branches/2.0/varnish-cache/bin/varnishtest/tests/r00345.vtc (from rev 3322, trunk/varnish-cache/bin/varnishtest/tests/r00345.vtc)
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/r00345.vtc	                        (rev 0)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/r00345.vtc	2008-10-20 08:55:24 UTC (rev 3325)
@@ -0,0 +1,40 @@
+# $Id$
+
+test "#345, ESI waitinglist trouble"
+
+server s1 {
+	rxreq 
+	txresp -body {<esi:include src="someurl">}
+	rxreq 
+	sema r1 sync 2
+	delay 1
+	txresp -body {DATA}
+} -start
+
+varnish v1 -arg "-p diag_bitmap=0x20" -vcl+backend {
+	sub vcl_fetch {
+		if (req.url == "/") {
+			esi;
+		}
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.bodylen == 4
+} -start
+
+client c2 {
+	txreq
+	sema r1 sync 2
+	rxresp
+	expect resp.bodylen == 4
+} -run
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.bodylen == 4
+} -run
+




More information about the varnish-commit mailing list