]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stream-int: make use of si_rx_chan_{rdy,blk} to control the stream-int from...
authorWilly Tarreau <w@1wt.eu>
Wed, 14 Nov 2018 16:10:36 +0000 (17:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:41:49 +0000 (21:41 +0100)
commitb26a6f97083138504abf3d61b1e0d698223a9dcb
tree28e3e5fee2755b7b04bb091432ac36f5fd2e9641
parent47baeb85d4b029efcceab6623452cc744d72dbcd
MEDIUM: stream-int: make use of si_rx_chan_{rdy,blk} to control the stream-int from the channel

The channel can disable reading from the stream-interface using various
methods, such as :
  - CF_DONT_READ
  - !channel_may_recv()
  - and possibly others

Till now this was done by mangling SI_FL_RX_WAIT_EP which is not
appropriate at all since it's not the stream interface which decides
whether it wants to deliver data or not. Some places were also wrongly
relying on SI_FL_RXBLK_ROOM since it was the only other alternative,
but it's not suitable for CF_DONT_READ.

Let's use the SI_FL_RXBLK_CHAN flag for this instead. It will properly
prevent the stream interface from being woken up and reads from
subscribing to more receipt without being accidently removed. It is
automatically reset if CF_DONT_READ is not set in stream_int_notify().

The code is not trivial because it splits the logic between everything
related to buffer contents (channel_is_empty(), CF_WRITE_PARTIAL, etc)
and buffer policy (CF_DONT_READ). Also it now needs to decide timeouts
based on any blocking flag and not just SI_FL_RXBLK_ROOM anymore.

It looks like this patch has caused a minor performance degradation on
connection rate, which possibly deserves being investigated deeper as
the test conditions are uncertain (e.g. slightly more subscribe calls?).
include/proto/stream_interface.h
src/stream_interface.c