From: Christopher Faulet Date: Wed, 1 Mar 2023 14:47:18 +0000 (+0100) Subject: BUG/MINOR: http-ana: Do a L7 retry on read error if there is no response X-Git-Tag: v2.8-dev5~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f78ac56059ac00265197c04b801a819dd730d8e;p=thirdparty%2Fhaproxy.git BUG/MINOR: http-ana: Do a L7 retry on read error if there is no response A regression about "empty-response" L7 retry was introduced with the commit dd6496f591 ("CLEANUP: http-ana: Remove useless if statement about L7 retries"). The if statetement was removed on a wrong assumption. Indeed, L7 retries on status is now handled in the HTTP analysers. Thus, the stream-connector (formely the conn-stream, and before again the stream-interface) no longer report a read error to force a retry. But it is still possible to get a read error with no response. In this case, we must perform a retry is "empty-response" is enabled. So the if statement is re-introduced, reverting the cleanup. This patch should fix the issue #2061. It must be backported as far as 2.4. --- diff --git a/src/http_ana.c b/src/http_ana.c index 3aebd42727..f0c0859808 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1217,7 +1217,15 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) if (sc_ep_test(s->scb, SE_FL_ERROR)) { struct connection *conn = sc_conn(s->scb); - /* Perform a L7 retry because server refuses the early data. */ + + if ((txn->flags & TX_L7_RETRY) && + (s->be->retry_type & PR_RE_DISCONNECTED) && + (!conn || conn->err_code != CO_ER_SSL_EARLY_FAILED)) { + if (co_data(rep) || do_l7_retry(s, s->scb) == 0) + return 0; + } + + /* Perform a L7 retry on empty response or because server refuses the early data. */ if ((txn->flags & TX_L7_RETRY) && (s->be->retry_type & PR_RE_EARLY_ERROR) && conn && conn->err_code == CO_ER_SSL_EARLY_FAILED &&