[master] b7572af Fixes an issue in backend probe initialization that causes the default value of .initial to equal .threshold.

Dag Haavi Finstad daghf at varnish-cache.org
Wed Mar 20 10:52:09 CET 2013


commit b7572affa9e7cc4c2d77c90c51e8bf2418ac9613
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Wed Mar 20 10:45:24 2013 +0100

    Fixes an issue in backend probe initialization that causes the default
    value of .initial to equal .threshold.
    
    The default for .initial is now .threshold - 1, meaning that the backend
    starts up as sick and a single successful poll is required for it to be
    considered healthy.
    
    With the previous behaviour, a sick backend would not be considered sick
    until after the initial polls exit the polling window.
    
    Thanks to Colin Curtin.
    
    Fixes: #1227

diff --git a/bin/varnishd/cache/cache_backend_poll.c b/bin/varnishd/cache/cache_backend_poll.c
index ab405f9..4780165 100644
--- a/bin/varnishd/cache/cache_backend_poll.c
+++ b/bin/varnishd/cache/cache_backend_poll.c
@@ -461,7 +461,7 @@ vbp_new_vcl(const struct vrt_backend_probe *p, const char *hosthdr)
 	if (vcl->probe.exp_status == 0)
 		vcl->probe.exp_status = 200;
 
-	if (vcl->probe.threshold == ~0U)
+	if (vcl->probe.initial == ~0U)
 		vcl->probe.initial = vcl->probe.threshold - 1;
 
 	if (vcl->probe.initial > vcl->probe.threshold)
diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index ca9c4c0..b5f5dec 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -201,8 +201,10 @@ Probes take the following parameters:
   the backend healthy.
   Defaults to 3.
 .initial
-  How many of the probes are considered good when Varnish starts.
-  Defaults to the same amount as the threshold.
+  How many of the polls in .window are considered good when Varnish
+  starts. Defaults to the value of threshold - 1. In this case, the
+  backend starts as sick and requires one single poll to be considered
+  healthy.
 .expected_response
   The expected backend HTTP response code.
   Defaults to 200.



More information about the varnish-commit mailing list