[4.0] 97da7f3 Continuously update our total object size estimate when cond-fetching a still-being-streamed object.

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:44 CET 2015


commit 97da7f346db387033fbda38c5a827af91ddb95cf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Dec 16 09:55:19 2014 +0000

    Continuously update our total object size estimate when cond-fetching a still-being-streamed object.
    
    Fixes:	#1646
    
    Keeping only the test case as the issue isn't in 4.0.
    
    Conflicts:
    	bin/varnishd/cache/cache_fetch.c

diff --git a/bin/varnishtest/tests/r01646.vtc b/bin/varnishtest/tests/r01646.vtc
new file mode 100644
index 0000000..951350e
--- /dev/null
+++ b/bin/varnishtest/tests/r01646.vtc
@@ -0,0 +1,54 @@
+varnishtest "cond/stream race ?"
+
+server s1 {
+	rxreq
+	txresp -nolen -hdr "Transfer-Encoding: chunked" -hdr "Etag: foo"
+	chunkedlen 32
+	sema r1 sync 3
+	chunkedlen 32
+	sema r2 sync 2
+	chunkedlen 32
+	chunkedlen 0
+} -start
+
+server s2 {
+	rxreq
+	expect req.http.if-none-match == "foo"
+	txresp -status 304
+} -start
+
+varnish v1 -vcl+backend {
+	sub vcl_backend_fetch {
+		if (bereq.http.foo == "s2") {
+			set bereq.backend = s2;
+		}
+	}
+	sub vcl_backend_response {
+		set beresp.ttl = 1s;
+		set beresp.grace = 0s;
+		set beresp.keep = 30s;
+	}
+} -start
+
+varnish v1 -cliok "param.set debug +syncvsl"
+
+client c1 {
+	txreq
+	rxresphdrs
+	sema r1 sync 3
+	rxrespbody
+	expect resp.bodylen == 96
+} -start
+
+client c2 {
+	sema r1 sync 3
+	delay 2
+	txreq -hdr "foo: s2"
+	rxresphdrs
+	sema r2 sync 2
+	rxrespbody
+	expect resp.bodylen == 96
+} -start
+
+client c1 -wait
+client c2 -wait



More information about the varnish-commit mailing list