MEDIUM: streams: Add the ability to retry a request on L7 failure.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 5 Apr 2019 13:30:12 +0000 (15:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 4 May 2019 08:19:56 +0000 (10:19 +0200)
commita254a37ad70e8ff266ff3d69ab16eb5303163f7b
treeb3425aac0574f40e746499efa14c378add1d800b
parentf4bda993dde4f7414a59d48cb3b009a29456d4ba
MEDIUM: streams: Add the ability to retry a request on L7 failure.

When running in HTX mode, if we sent the request, but failed to get the
answer, either because the server just closed its socket, we hit a server
timeout, or we get a 404, 408, 425, 500, 501, 502, 503 or 504 error,
attempt to retry the request, exactly as if we just failed to connect to
the server.

To do so, add a new backend keyword, "retry-on".

It accepts a list of keywords, which can be "none" (never retry),
"conn-failure" (we failed to connect, or to do the SSL handshake),
"empty-response" (the server closed the connection without answering),
"response-timeout" (we timed out while waiting for the server response),
or "404", "408", "425", "500", "501", "502", "503" and "504".

The default is "conn-failure".
12 files changed:
doc/configuration.txt
doc/internals/filters.txt
include/proto/proxy.h
include/types/filters.h
include/types/proxy.h
include/types/stream_interface.h
src/cfgparse-listen.c
src/cfgparse.c
src/proto_htx.c
src/proxy.c
src/stream.c
src/stream_interface.c