]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: mux_pt: always report the connection error to the conn_stream
authorWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2022 14:47:46 +0000 (16:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2022 14:55:52 +0000 (16:55 +0200)
commit413713f02a73970122fd41c668b655daa38a98ae
tree205859128beb6f286640fc964cf25a3df3e4b817
parenta662275e84310038db39c12e84df9d7422d9c2c9
BUG/MAJOR: mux_pt: always report the connection error to the conn_stream

Over time we've tried hard to abstract connection errors from the upper
layers so that they're reported per stream and not per connection. As
early as 1.8-rc1, commit 4ff3b8964 ("MINOR: connection: make conn_stream
users also check for per-stream error flag") did precisely this, but
strangely only for rx, not for tx (probably that by then send errors
were not imagined to be reported that way).

And this lack of Tx error check was just revealed in 2.6 by recent commit
d1480cc8a ("BUG/MEDIUM: stream-int: do not rely on the connection error
once established") that causes wakeup loops between si_cs_send() failing
to send via mux_pt_snd_buf() and subscribing against si_cs_io_cb() in
loops because the function now rightfully only checks for CS_FL_ERROR
and not CO_FL_ERROR.

As found by Amaury, this causes aborted "show events -w" to cause
haproxy to loop at 100% CPU.

This fix theoretically needs to be backported to all versions, though
it will be necessary and sufficient to backport it wherever 4ff3b8964
gets backported.
src/mux_pt.c