]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream-int: Don't rely on CF_WRITE_PARTIAL to unblock opposite si
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jul 2019 11:44:29 +0000 (13:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jul 2019 12:26:15 +0000 (14:26 +0200)
commit037b3ebd3502e9eb7bbe7e56187ce1f929b4a02e
tree12d677024c96d2bfda3e551b00873d6dec6ccca5
parent86162db15c439479d154b352d40d2477f39f4fcf
BUG/MEDIUM: stream-int: Don't rely on CF_WRITE_PARTIAL to unblock opposite si

In the function stream_int_notify(), when the opposite stream-interface is
blocked because there is no more room into the input buffer, if the flag
CF_WRITE_PARTIAL is set on this buffer, it is unblocked. It is a way to unblock
the reads on the other side because some data was sent.

But it is a problem during the fast-forwarding because only the stream is able
to remove the flag CF_WRITE_PARTIAL. So it is possible to have this flag because
of a previous send while the input buffer of the opposite stream-interface is
now full. In such case, the opposite stream-interface will be woken up for
nothing because its input buffer is full. If the same happens on the opposite
side, we will have a loop consumming all the CPU.

To fix the bug, the opposite side is now only notify if there is some available
room in its input buffer in the function si_cs_send(), so only if some data was
sent.

This patch must be backported to 2.0 and 1.9.
include/proto/channel.h
src/stream_interface.c