]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stream: Attach the read side on the response as soon as possible
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 May 2019 09:46:52 +0000 (11:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 May 2019 09:47:00 +0000 (11:47 +0200)
commit7a3367cca0d1fddcfe6d13da31d0607dbd24e29e
tree44079c838a61a39c3c2f8137e75e4d9020b7c2eb
parentf4436e145bec624aca94a42cefc81bacaa5c94a5
BUG/MINOR: stream: Attach the read side on the response as soon as possible

A backend stream-interface attached to a reused connection remains in the state
SI_ST_CONN until some data are sent to validate the connection. But when the
url_param algorithm is used to balance connections, no data are sent while the
connection is not established. So it is a chicken and egg situation.

To solve the problem, if no error is detected and when the request channel is
waiting for the connect(), we mark the read side as attached on the response
channel as soon as possible and we wake the request channel up once. This
happens in 2 places. The first one is right after the connect(), when the
stream-interface is still in state SI_ST_CON, in the function
sess_update_st_con_tcp(). The second one is when an applet is used instead of a
real connection to a server, in the function sess_prepare_conn_req(). In fact,
it is done when the backend stream-interface is set to the state SI_ST_EST.

This patch must be backported to 1.9.
src/stream.c