r3106 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 19 11:34:44 CEST 2008


Author: phk
Date: 2008-08-19 11:34:44 +0200 (Tue, 19 Aug 2008)
New Revision: 3106

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
Log:
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.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2008-08-19 08:16:36 UTC (rev 3105)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2008-08-19 09:34:44 UTC (rev 3106)
@@ -417,7 +417,6 @@
 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);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2008-08-19 08:16:36 UTC (rev 3105)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2008-08-19 09:34:44 UTC (rev 3106)
@@ -348,34 +348,3 @@
 	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
-}

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2008-08-19 08:16:36 UTC (rev 3105)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2008-08-19 09:34:44 UTC (rev 3106)
@@ -342,14 +342,11 @@
 	/* 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 @@
 	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 @@
 	} 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 @@
 			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 @@
 	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




More information about the varnish-commit mailing list