Patch review for limiting backend retry on post

Poul-Henning Kamp phk at
Wed Aug 3 10:50:49 CEST 2011

In message <CANTn4cqAsu33ZPGO-0oZDYzRkY+Ztm4xcS7HT5KkQjep5Edd4A at>
, Martin Blix Grydeland writes:

>   Do not retry a backend connection if we have ever read any of the
>   request body bytes.

I'm not keen in the pointer retry-arg, it should just be another
return {enum} value, for sanity something like:

	-2 body write failed
	-1 body read failed
	0 no body
	1 body successfully transfered.

In reality, the retry decision should not be based on the body-xfer
but on the HTTP request:  Only GET and HEAD are really safe to retry.

This can be extended so that if we know that the server never had a
chance to act, we can also retry POST/PUT/... but that is a somewhat
slippery criteria to test, for a relatively small gain.

At some point we probably should bite the bullet and buffer the
request body so we can do this sensibly.  That would also allow
people to do things with it from VCL/VMOD.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list