BUG/MEDIUM: stream-int: Block reads if channel cannot receive more data
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Oct 2021 12:55:59 +0000 (14:55 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Nov 2021 15:21:32 +0000 (16:21 +0100)
commitae761da14671cf6063c04f803e5c66da3512f80f
tree55d304629ccab65c208bf9cf670cfb2fa3e3d0ab
parente9edb5fc025b0f138f16baca5a8a07aa92712065
BUG/MEDIUM: stream-int: Block reads if channel cannot receive more data

First of all, we must be careful here because this part was modified and
each time, this introduced a bug. But, in si_update_rx(), we must not
re-enables receives if the channel buffer cannot receive more
data. Otherwise the multiplexer will be wake up for nothing. Because the
stream is woken up when the multiplexer is waiting for more room to move on,
this may lead to a ping-pong loop between the stream and the mux.

Note that for now, it does not fix any known bug. All reported issues in
this area were fixed in another way.

This patch must be backported with a special care. Technically speaking, it
may be backported as far as 2.0.

(cherry picked from commit 69fad00ebf65ad0dedabaf10db43fb3783f7ecae)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit dce066777a3072945c3b52210f503104139c2b0d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/stream_interface.c