]> err.no Git - varnish/commitdiff
Tada!
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 09:47:49 +0000 (09:47 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 09:47:49 +0000 (09:47 +0000)
First step in activating backend polling:  Do not attempt to open
connections to a unhealthy backend.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3132 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/include/stat_field.h

index 49672141bcbd5c7c48ee5081e016850a463041a4..53afab0c03c88410521540a8189aaa4dea3c67d6 100644 (file)
@@ -313,6 +313,11 @@ VBE_GetVbe(struct sess *sp, struct backend *bp)
                VBE_ClosedFd(sp);
        }
 
+       if (!bp->healthy) {
+               VSL_stats->backend_unhealthy++;
+               return (NULL);
+       }
+
        vc = VBE_NewConn();
        assert(vc->fd == -1);
        AZ(vc->backend);
index b46e26c1fc2a43ff4e49ba45320fdd885af1cd9e..86f7b6786dd42649fcdfc02b4f0d1d3bb706dcc4 100644 (file)
@@ -37,6 +37,7 @@ MAC_STAT(cache_hitpass,               uint64_t, 'a', "Cache hits for pass")
 MAC_STAT(cache_miss,           uint64_t, 'a', "Cache misses")
 
 MAC_STAT(backend_conn,         uint64_t, 'a', "Backend connections success")
+MAC_STAT(backend_unhealthy,    uint64_t, 'a', "Backend connections not attempted")
 MAC_STAT(backend_fail,         uint64_t, 'a', "Backend connections failures")
 MAC_STAT(backend_reuse,                uint64_t, 'a', "Backend connections reuses")
 MAC_STAT(backend_recycle,      uint64_t, 'a', "Backend connections recycles")