Le 29/08/2017 à 10:13, Kristjan Koppel a écrit :
Hi!
It seems that a similar issue to the one I originally reported against v1.7.2
is now present in v1.7.9 (the same setup worked fine with v1.7.8):
https://www.mail-archive.com/[email protected]/msg24830.html
After upgrading to v1.7.9, requests from a client using HTTP/1.0 with compression enabled
in HAProxy now always hang. Usually they hang after receiving 3905 bytes of data, but
sometimes also after 11145 bytes (the full response is much larger). After hanging for
"timeout client" seconds the rest of the response is received and the request
finishes successfully.
Using HTTP/1.1 or turning off compression fixes the issue as before. My backend
server is still the same etcd v2.3.7 and the client is a custom application
using HTTP/1.0. Issue was confirmed with curl in HTTP/1.0 mode.
I'll be happy to provide additional information if needed.
Hi Kristjan,
Damn ! I was pretty sure to have test this use-case when I fixed the
HTTP parser few weeks ago. But clearly not, because the bug is back.
Could you check if the attached patch fixes the bug ?
For my part, I will recheck everything to be sure. This will be my
punishment.
Thanks,
--
Christopher Faulet
>From 57e627243b02021b3913b33c8bd5c2ed92f82303 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Tue, 29 Aug 2017 16:06:38 +0200
Subject: [PATCH] BUG/MEDIUM: http: Fix a regression bug in http_resync_states
Unfortunatly, a regression bug in http_resync_states was introduced in the
commit 1486b0ab ("BUG/MEDIUM: http: Switch HTTP responses in TUNNEL mode when
body length is undefined"). HTTP/1.0 responses with undefined body length are
blocked until timeout when the compression is enabled. This bug was fixed in
commit 69744d92 ("BUG/MEDIUM: http: Fix blocked HTTP/1.0 responses when
compression is enabled").
To fix the bug, in http_resync_states, when one side is in HTTP_MSG_TUNNEL state
but the other one is still in HTTP_MSG_DONE state, we remove remaining analyzers
except corresponding _FLT_END one.
This patch must be backported in 1.7.
---
src/proto_http.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/proto_http.c b/src/proto_http.c
index 439e57fce..c0e2e1115 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -5618,11 +5618,15 @@ void http_resync_states(struct stream *s)
s->req.analysers &= AN_REQ_FLT_END;
if (HAS_REQ_DATA_FILTERS(s))
s->req.analysers |= AN_REQ_FLT_XFER_DATA;
+ if (txn->rsp.msg_state == HTTP_MSG_DONE)
+ s->res.analysers &= AN_RES_FLT_END;
}
if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
s->res.analysers &= AN_RES_FLT_END;
if (HAS_RSP_DATA_FILTERS(s))
s->res.analysers |= AN_RES_FLT_XFER_DATA;
+ if (txn->req.msg_state == HTTP_MSG_DONE)
+ s->req.analysers &= AN_REQ_FLT_END;
}
channel_auto_close(&s->req);
channel_auto_read(&s->req);
--
2.13.5