Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Merge r4233: Add SHMLOG records for more backend fetch failures
Browse files Browse the repository at this point in the history
git-svn-id: http://www.varnish-cache.org/svn/branches/2.0@4327 d4fa192b-c00b-0410-8231-f00ffab90ce4
  • Loading branch information
Tollef Fog Heen committed Oct 13, 2009
1 parent 3122a82 commit 2163b08
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions bin/varnishd/cache_fetch.c
Expand Up @@ -350,8 +350,10 @@ Fetch(struct sess *sp)
/* 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);
Expand All @@ -371,6 +373,7 @@ Fetch(struct sess *sp)
/* 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__);
Expand All @@ -386,17 +389,19 @@ Fetch(struct sess *sp)
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__);
Expand Down Expand Up @@ -531,5 +536,3 @@ Fetch_Init(void)

CLI_AddFuncs(DEBUG_CLI, debug_cmds);
}


0 comments on commit 2163b08

Please sign in to comment.