[3.0] 3271c51 Ignore missing reason in probe responses
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Sep 12 19:05:15 CEST 2016
commit 3271c51e303b1f187d851cdaf056a940ccaa8365
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Mon Sep 12 18:53:05 2016 +0200
Ignore missing reason in probe responses
Fixes #2069
diff --git a/bin/varnishd/cache_backend_poll.c b/bin/varnishd/cache_backend_poll.c
index 4995a57..6dfa6d1 100644
--- a/bin/varnishd/cache_backend_poll.c
+++ b/bin/varnishd/cache_backend_poll.c
@@ -226,7 +226,7 @@ vbp_poke(struct vbp_target *vt)
i = sscanf(vt->resp_buf, "HTTP/%*f %u %s", &resp, buf);
- if (i == 2 && resp == vt->probe.exp_status)
+ if (i >= 1 && resp == vt->probe.exp_status)
vt->happy |= 1;
}
diff --git a/bin/varnishtest/tests/r02069.vtc b/bin/varnishtest/tests/r02069.vtc
new file mode 100644
index 0000000..8cf4df1
--- /dev/null
+++ b/bin/varnishtest/tests/r02069.vtc
@@ -0,0 +1,36 @@
+varnishtest "Probe response without a reason"
+
+server s1 -repeat 20 {
+ rxreq
+ send "HTTP/1.1 200\r\n\r\n"
+} -start
+
+varnish v1 -vcl {
+ backend s1 {
+ .host = "${s1_addr}";
+ .port = "${s1_port}";
+ .probe = {
+ .initial = 0;
+ .window = 5;
+ .threshold = 5;
+ .interval = 100ms;
+ }
+ }
+
+ sub vcl_recv {
+ if (req.backend.healthy) {
+ error 200 "Backend healthy";
+ }
+ else {
+ error 500 "Backend sick";
+ }
+ }
+} -start
+
+delay 1
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+} -run
More information about the varnish-commit
mailing list