]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: streams: Don't give up if we couldn't send the request.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 12 Jul 2019 13:48:58 +0000 (15:48 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 12 Jul 2019 14:17:50 +0000 (16:17 +0200)
In htx_request_forward_body(), don't give up if we failed to send the request,
and we have L7 retries activated. If we do, we will not retry when we should.

This should be backported to 2.0.

src/proto_htx.c

index d5119c1000cbc6431bdf020885fcb679f49fb14e..cbe5c84e0c4612fa4d5983ddf80b8faeaeec3a1c 100644 (file)
@@ -1163,6 +1163,12 @@ int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit)
                /* Output closed while we were sending data. We must abort and
                 * wake the other side up.
                 */
+               /* Don't abort yet if we had L7 retries activated and it
+                * was a write error, we may recover.
+                */
+               if (!(req->flags & (CF_READ_ERROR | CF_READ_TIMEOUT)) &&
+                   (s->si[1].flags & SI_FL_L7_RETRY))
+                       return 0;
                msg->err_state = msg->msg_state;
                msg->msg_state = HTTP_MSG_ERROR;
                htx_end_request(s);