Commit 4901ccd4 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

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: http://www.varnish-cache.org/svn/trunk@3106 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 007a1d96
......@@ -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);
......
......@@ -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
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment