r4327 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Tue Oct 13 11:32:22 CEST 2009


Author: tfheen
Date: 2009-10-13 11:32:22 +0200 (Tue, 13 Oct 2009)
New Revision: 4327

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_fetch.c
Log:
Merge r4233: Add SHMLOG records for more backend fetch failures


Modified: branches/2.0/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_fetch.c	2009-10-13 09:23:25 UTC (rev 4326)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_fetch.c	2009-10-13 09:32:22 UTC (rev 4327)
@@ -350,8 +350,10 @@
 	/* Set up obj's workspace */
 	WS_Assert(sp->obj->ws_o);
 	VBE_GetFd(sp);
-	if (sp->vbe == NULL)
+	if (sp->vbe == NULL) {
+		WSP(sp, SLT_FetchError, "no backend connection");
 		return (__LINE__);
+	}
 	vc = sp->vbe;
 	/* Inherit the backend timeouts from the selected backend */
 	SES_InheritBackendTimeouts(sp);
@@ -371,6 +373,7 @@
 	/* Deal with any message-body the request might have */
 	i = FetchReqBody(sp);
 	if (WRW_FlushRelease(w) || i > 0) {
+		WSP(sp, SLT_FetchError, "backend write error: %d", errno);
 		VBE_ClosedFd(sp);
 		/* XXX: other cleanup ? */
 		return (__LINE__);
@@ -386,17 +389,19 @@
 	TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
 	do {
 		i = HTC_Rx(htc);
+		if (i < 0) {
+			WSP(sp, SLT_FetchError,
+			    "http read error: %d", errno);
+			VBE_ClosedFd(sp);
+			/* XXX: other cleanup ? */
+			return (__LINE__);
+		}
 		TCP_set_read_timeout(vc->fd, sp->between_bytes_timeout);
 	}
 	while (i == 0);
 
-	if (i < 0) {
-		VBE_ClosedFd(sp);
-		/* XXX: other cleanup ? */
-		return (__LINE__);
-	}
-
 	if (http_DissectResponse(sp->wrk, htc, hp)) {
+		WSP(sp, SLT_FetchError, "http format error");
 		VBE_ClosedFd(sp);
 		/* XXX: other cleanup ? */
 		return (__LINE__);
@@ -531,5 +536,3 @@
 
 	CLI_AddFuncs(DEBUG_CLI, debug_cmds);
 }
-
-



More information about the varnish-commit mailing list