Commit 1e5f6761 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Retry backend fetches one time if we got a recycled conncetion and

the transfer failed before we received anything.

Fixes: #749



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5102 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a4b84805
......@@ -439,6 +439,15 @@ cnt_fetch(struct sess *sp)
http_Setup(sp->wrk->beresp, sp->wrk->ws);
i = FetchHdr(sp);
/*
* If we recycle a backend connection, there is a finite chance
* that the backend closed it before we get a request to it.
* Do a single retry in that case.
*/
if (i == 1) {
VSC_main->backend_retry++;
i = FetchHdr(sp);
}
/*
* Save a copy before it might get mangled in VCL. When it comes to
......
......@@ -55,6 +55,7 @@ VSC_F_MAIN(backend_reuse, uint64_t, 0, 'a', "Backend conn. reuses")
VSC_F_MAIN(backend_toolate, uint64_t, 0, 'a', "Backend conn. was closed")
VSC_F_MAIN(backend_recycle, uint64_t, 0, 'a', "Backend conn. recycles")
VSC_F_MAIN(backend_unused, uint64_t, 0, 'a', "Backend conn. unused")
VSC_F_MAIN(backend_retry, uint64_t, 0, 'a', "Backend conn. retry")
VSC_F_MAIN(fetch_head, uint64_t, 1, 'a', "Fetch head")
VSC_F_MAIN(fetch_length, uint64_t, 1, 'a', "Fetch with Length")
......
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