BUG/MAJOR: stconn: Disable zero-copy forwarding if consumer is shut or in error
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 09:27:53 +0000 (10:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jan 2024 06:45:39 +0000 (07:45 +0100)
commit5929895b4bac7f097a2ab886897f8068234fdadf
tree25c9a056f7fd0a562e6fa0a95dbaaee2a3a8ab87
parenta13b043dcc25387567d9e2c6624eb1f4bc9ecefb
BUG/MAJOR: stconn: Disable zero-copy forwarding if consumer is shut or in error

A regression was introduced by commit 2421c6fa7d ("BUG/MEDIUM: stconn: Block
zero-copy forwarding if EOS/ERROR on consumer side"). When zero-copy
forwarding is inuse and the consumer side is shut or in error, we declare it
as blocked and it is woken up. The idea is to handle this state at the
stream-connector level. However this definitly blocks receives on the
producer side. So if the mux is unable to close by itself, but instead wait
the peer to shut, this can lead to a wake up loop. And indeed, with the
passthrough multiplexer this may happen.

To fix the issue and prevent any loop, instead of blocking the zero-copy
forwarding, we now disable it. This way, the stream-connector on producer
side will fallback on classical receives and will be able to handle peer
shutdown properly. In addition, the wakeup of the consumer side was
removed. This will be handled, if necessary, by sc_notify().

This patch should fix the issue #2395. It must be backported to 2.9.

(cherry picked from commit 123a9e7d83213bcc0478840bab2270113275fb0a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/stconn.h