]> err.no Git - varnish/commitdiff
Evict backend-health code which had strayed fra from it's proper place.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 20:19:50 +0000 (20:19 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 20:19:50 +0000 (20:19 +0000)
cache_fetch.c now reports the response code or a indicative negative
status for failed requests to the backend code.

Any timeouts, keepalives or other overhead processing of health codes
should happen in a thread in the backend handling.

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

varnish-cache/bin/varnishd/cache_center.c

index b48130de62aa1bed9d720830cf8291c84e0c5fd6..127a6b4436d5b08e5a411121d88b80b6dc504879 100644 (file)
@@ -304,12 +304,6 @@ cnt_fetch(struct sess *sp)
        sp->bereq = NULL;
 
        if (i) {
-               /* Experimental. If the fetch failed, it would also seem
-                * to be a backend problem, so decrease the health parameter.
-                */
-               if (sp->backend->health > -10000)
-                       sp->backend->health--;
-
                SYN_ErrorPage(sp, 503, "Error talking to backend", 30);
        } else {
                RFC2616_cache_policy(sp, &sp->obj->http);       /* XXX -> VCL */
@@ -402,22 +396,9 @@ DOT hit -> deliver [label="deliver",style=bold,color=green,weight=4]
 static int
 cnt_hit(struct sess *sp)
 {
-       double time_diff;
-       double minutes;
 
        assert(!sp->obj->pass);
 
-       /* Experimental. Reduce health parameter of backend towards zero
-        * if it has been more than a minute since it was checked. */
-       CHECK_OBJ_NOTNULL(sp->backend, BACKEND_MAGIC);
-       time_diff = TIM_mono() - sp->backend->last_check;
-       minutes = time_diff / 60;
-       if (minutes > sp->backend->minute_limit) {
-               sp->backend->minute_limit++;
-               sp->backend->health = (int)((double)sp->backend->health / 2);
-               VBE_UpdateHealth(sp, NULL, 0);
-       }
-
        VCL_hit_method(sp);
 
        if (sp->handling == VCL_RET_DELIVER) {