mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
In version 2.0, after commit 9c218e7521 ("MAJOR: mux-h2: switch to next mux buffer on buffer full condition."), the H2 mux started to use a ring buffer for the output data in order to reduce competition between streams. However, one corner case was suboptimally covered: when crossing a buffer boundary, we have to shrink the outgoing frame size to the one left in the output buffer, but this shorter size is later used as a signal of incomplete send due to a buffer full condition (which used to be true when using a single buffer). As a result, function h2s_frt_make_resp_data() used to return less than requested, which in turn would cause h2_snd_buf() to stop sending and leave some unsent data in the buffer, and si_cs_send() to subscribe for sending more later. But it goes a bit further than this, because subscribing to send again causes the mux's send_list not to be empty anymore, hence extra streams can be denied the access to the mux till the first stream is woken again. This causes a nasty wakeup-sleep dance between streams that makes it totally impractical to try to remove the sending list. A test showed that it was possible to observe 3 million h2_snd_buf() giveups for only 100k requests when using 100 concurrent streams on 20kB objects. It doesn't seem likely that a stream could get blocked and time out due to this bug, though it's not possible either to demonstrate the opposite. One risk is that incompletely sent streams do not have any blocking flags so they may not be identified as blocked. However on first scan of the send_list they meet all conditions for a wakeup. This patch simply allows to continue on a new frame after a partial frame. with only this change, the number of failed h2_snd_buf() was divided by 800 (4% of calls). And by slightly increasing the H2C_MBUF_CNT size, it can go down to zero. This fix must be backported to 2.1 and 2.0.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%