mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-04 03:02:07 +00:00
d247152ec2
In sc_need_room(), we compute the maximum room that can be requested to restarted reading to be sure to be able to unblock the SC. At worst when the buffer is emptied. Here, the buffer reserve is considered but it is an issue. Counting the reserve can lead to a wicked bug with the H1 multiplexer, when small amount of data are found at the end of the HTX buffer. In this case, to not wrap, the H1 mux requests more room. It is an optim to be able to resync the buffer with the consumer side and to be able to perform zero-copy transfers. However, if this amount of data is smaller than the reserve and if the consumer is congested, we fall in a loop because the wrong value is used to request more room. The H1 mux continues to pretend there is not enough space in the buffer, while the effective requested value is lower than the free space in the buffer. While the consumer is congested and does not consume these data, the is no way to stop the loop. We can fix the function by removing the buffer reserve from the computation. But it remains a dangerous decision to apply a max value on room_needed. It is safer to require the caller must set a correct value. For now, it is true. But at the end, it is totally unexepected to wait for more room than an empty buffer can contain. This patch must be backported to 2.8. |
||
---|---|---|
.. | ||
haproxy | ||
import | ||
make |