From: Olivier Houchard Date: Fri, 10 May 2019 16:05:40 +0000 (+0200) Subject: MINOR: streams: Introduce a new retry-on keyword, all-retryable-errors. X-Git-Tag: v2.0-dev3~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ddf0e03585d3d8d8fb01566198faf3561fe392c3;p=thirdparty%2Fhaproxy.git MINOR: streams: Introduce a new retry-on keyword, all-retryable-errors. Add a new retry-on keyword, "all-retryable-errors", that activates retry for all errors that are considered retryable. This currently activates retry for "conn-failure", "empty-response", "junk-respones", "response-timeout", "0rtt-rejected", "500", "502", "503" and "504". --- diff --git a/doc/configuration.txt b/doc/configuration.txt index f88dad876e..754ea8bec3 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -8062,6 +8062,12 @@ retry-on [list of keywords] Error), "501" (Not Implemented), "502" (Bad Gateway), "503" (Service Unavailable), "504" (Gateway Timeout). + all-retryable-errors + retry request for any error that are considered + retryable. This currently activates "conn-failure", + "empty-response", "junk-response", "response-timeout", + "0rtt-rejected", "500", "502", "503", and "504". + Using this directive replaces any previous settings with the new ones; it is not cumulative. diff --git a/src/proxy.c b/src/proxy.c index 3c599d6837..7b8e29450a 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -545,6 +545,11 @@ proxy_parse_retry_on(char **args, int section, struct proxy *curpx, curpx->retry_type |= PR_RE_EARLY_ERROR; else if (!strcmp(args[i], "junk-response")) curpx->retry_type |= PR_RE_JUNK_REQUEST; + else if (!(strcmp(args[i], "all-retryable-errors"))) + curpx->retry_type |= PR_RE_CONN_FAILED | PR_RE_DISCONNECTED | + PR_RE_TIMEOUT | PR_RE_500 | PR_RE_502 | + PR_RE_503 | PR_RE_504 | PR_RE_EARLY_ERROR | + PR_RE_JUNK_REQUEST; else if (!strcmp(args[i], "none")) { if (i != 1 || *args[i + 1]) { memprintf(err, "'%s' 'none' keyworld only usable alone", args[0]);