From: phk Date: Tue, 19 Aug 2008 09:34:44 +0000 (+0000) Subject: Don't attempt to update the Health information based on how regular X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261934962ac1a5c05ffa0da08c5a12130b44fc33;p=varnish Don't attempt to update the Health information based on how regular traffic fares. Problems seen there could be caused by all sorts of special circumstances (bad PHP, weird headers from client etc) and is not indicative of the backends health. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3106 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 279d5a3f..28d8ef62 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -417,7 +417,6 @@ void VBE_ClosedFd(struct worker *w, struct vbe_conn *vc); void VBE_RecycleFd(struct worker *w, struct vbe_conn *vc); struct bereq * VBE_new_bereq(void); void VBE_free_bereq(struct bereq *bereq); -void VBE_UpdateHealth(const struct sess *sp, const struct vbe_conn *, int); void VBE_AddHostHeader(const struct sess *sp); void VBE_Poll(void); diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index c994607d..277c173d 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -348,34 +348,3 @@ VBE_RecycleFd(struct worker *w, struct vbe_conn *vc) VBE_DropRefLocked(vc->backend); CHECK_OBJ_NOTNULL(bp, BACKEND_MAGIC); } - -/* Update health ----------------------------------------------------*/ -/* See cache_backend_random.c and/or cache_backend_round_robin.c for - * details and comments about this function. - */ -void -VBE_UpdateHealth(const struct sess *sp, const struct vbe_conn *vc, int a) -{ - (void)sp; - (void)vc; - (void)a; -#if 0 - INCOMPL(); - struct backend *b; - - if (vc != NULL) { - CHECK_OBJ_NOTNULL(vc, VBE_CONN_MAGIC); - CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC); - b = vc->backend; - } - else { - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->backend, BACKEND_MAGIC); - b = sp->backend; - } - AN(b->method); - if (b->method->updatehealth != NULL) - b->method->updatehealth(sp, vc, a); - CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC); -#endif -} diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 1202dde6..b5e11682 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -342,14 +342,11 @@ Fetch(struct sess *sp) /* Deal with any message-body the request might have */ i = FetchReqBody(sp); if (i > 0) { - if (i > 1) - VBE_UpdateHealth(sp, vc, -1); VBE_ClosedFd(sp->wrk, vc); return (__LINE__); } if (WRK_Flush(w)) { - VBE_UpdateHealth(sp, vc, -1); VBE_ClosedFd(sp->wrk, vc); /* XXX: other cleanup ? */ return (__LINE__); @@ -364,14 +361,12 @@ Fetch(struct sess *sp) while (i == 0); if (i < 0) { - VBE_UpdateHealth(sp, vc, -1); VBE_ClosedFd(sp->wrk, vc); /* XXX: other cleanup ? */ return (__LINE__); } if (http_DissectResponse(sp->wrk, htc, hp)) { - VBE_UpdateHealth(sp, vc, -2); VBE_ClosedFd(sp->wrk, vc); /* XXX: other cleanup ? */ return (__LINE__); @@ -404,7 +399,6 @@ Fetch(struct sess *sp) } else if (http_GetHdr(hp, H_Transfer_Encoding, &b)) { /* XXX: AUGH! */ WSL(sp->wrk, SLT_Debug, vc->fd, "Invalid Transfer-Encoding"); - VBE_UpdateHealth(sp, vc, -3); VBE_ClosedFd(sp->wrk, vc); return (__LINE__); } else { @@ -425,7 +419,6 @@ Fetch(struct sess *sp) VTAILQ_REMOVE(&sp->obj->store, st, list); STV_free(st); } - VBE_UpdateHealth(sp, vc, -4); VBE_ClosedFd(sp->wrk, vc); sp->obj->len = 0; return (__LINE__); @@ -448,8 +441,6 @@ Fetch(struct sess *sp) if (http_GetHdr(hp, H_Connection, &b) && !strcasecmp(b, "close")) cls = 1; - VBE_UpdateHealth(sp, vc, http_GetStatus(sp->bereq->http)); - if (cls) VBE_ClosedFd(sp->wrk, vc); else