BUG/MEDIUM: streams: Try to L7 retry before aborting the connection.

In htx_wait_for_response, in case of error, attempt a L7 retry before
aborting the connection if the TX_NOT_FIRST flag is set.
If we don't do that, then we wouldn't attempt L7 retries after the first
request, or if we use HTTP/2, as with HTTP/2 that flag is always set.
This commit is contained in:
Olivier Houchard 2019-05-17 15:40:49 +02:00 committed by Olivier Houchard
parent ce1a0292bf
commit 6db1699f77

View File

@ -1496,9 +1496,6 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
if (rep->flags & CF_READ_ERROR) {
struct connection *conn = NULL;
if (txn->flags & TX_NOT_FIRST)
goto abort_keep_alive;
if (objt_cs(s->si[1].end))
conn = objt_cs(s->si[1].end)->conn;
@ -1514,6 +1511,9 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
return 0;
}
if (txn->flags & TX_NOT_FIRST)
goto abort_keep_alive;
_HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1);
if (objt_server(s->target)) {
_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);
@ -1591,15 +1591,15 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
/* 4: close from server, capture the response if the server has started to respond */
else if (rep->flags & CF_SHUTR) {
if (txn->flags & TX_NOT_FIRST)
goto abort_keep_alive;
if ((si_b->flags & SI_FL_L7_RETRY) &&
(s->be->retry_type & PR_RE_DISCONNECTED)) {
if (co_data(rep) || do_l7_retry(s, si_b) == 0)
return 0;
}
if (txn->flags & TX_NOT_FIRST)
goto abort_keep_alive;
_HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1);
if (objt_server(s->target)) {
_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);