[master] bbfc5df51 Stabilize c91

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jan 2 08:26:07 UTC 2020


commit bbfc5df51b203dd1578c09254b33e34ae7c08b3e
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Jan 2 09:13:41 2020 +0100

    Stabilize c91
    
    There was a race with the reuse of s1 and server -dispatch was the
    simplest way to also circumvent the race where varnish could retry
    before s1 would reach the next accept action.
    
    While at it, add coverage for the 503 case.

diff --git a/bin/varnishtest/tests/c00091.vtc b/bin/varnishtest/tests/c00091.vtc
index 59c63d1d8..4979a0eb1 100644
--- a/bin/varnishtest/tests/c00091.vtc
+++ b/bin/varnishtest/tests/c00091.vtc
@@ -1,50 +1,41 @@
 varnishtest	"vcl_backend_response{} retry with a UDS backend"
 
-server s1 -listen "${tmpdir}/s1.sock" {
+server s0 -listen "${tmpdir}/s1.sock" {
 	rxreq
-	txresp -hdr "foo: 1"
-	accept
-	rxreq
-	txresp -hdr "foo: 2"
-} -start
+	txresp -hdr "connection: close"
+} -dispatch
 
 varnish v1 -vcl+backend {
 	sub vcl_recv { return (pass); }
 	sub vcl_backend_response {
-		set beresp.http.bar = bereq.retries;
-		if (beresp.http.foo != bereq.http.stop) {
+		set beresp.http.retries = bereq.retries;
+		if (bereq.http.stop != beresp.http.retries) {
 			return (retry);
 		}
 	}
 } -start
 
-varnish v1 -cliok "param.set debug +syncvsl"
-
 client c1 {
 	txreq -hdr "stop: 2"
 	rxresp
-	expect resp.http.foo == 2
+	expect resp.status == 200
+	expect resp.http.retries == 2
 } -run
 
-delay .1
-
-server s1 -listen "${tmpdir}/s1.sock" {
-	rxreq
-	txresp -hdr "foo: 1"
-	accept
-	rxreq
-	txresp -hdr "foo: 2"
-	accept
-	rxreq
-	txresp -hdr "foo: 3"
-} -start
-
 varnish v1 -cliok "param.set max_retries 2"
 
-client c1 {
+client c2 {
+	txreq -hdr "stop: 2"
+	rxresp
+	expect resp.status == 200
+	expect resp.http.retries == 2
+} -run
+
+client c3 {
 	txreq -hdr "stop: 3"
 	rxresp
-	expect resp.http.foo == 3
+	expect resp.status == 503
+	expect resp.http.retries == <undef>
 } -run
 
-# XXX: Add a test which exceeds max_retries and gets 503 back
+varnish v1 -expect backend_conn == 9


More information about the varnish-commit mailing list