]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mux-h2: always check the stream ID limit in h2_avail_streams()
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Jan 2019 09:22:21 +0000 (10:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2019 18:06:43 +0000 (19:06 +0100)
commitd64a3ebe64eca09a602aa650ced1951867f4ed34
tree956fb8aac9e2e437ba16d9efe1943304e5d57af4
parent15c120d251583301eaa118423c9d76e04424ea44
BUG/MINOR: mux-h2: always check the stream ID limit in h2_avail_streams()

This function is used to decide whether to put an idle connection back
into the idle pool. While it considers the limit in number of concurrent
requests, it does not consider the limit in number of streams, so if a
server announces a low limit in a GOAWAY frame, it will be ignored.

However there is a caveat : since we assign the stream IDs when sending
them, we have a number of allocated streams which max_id doesn't take
care of. This can be addressed by adding a new nb_reserved count on each
connection to keep track of the ID-less streams.

This patch makes sure we take care of the remaining number of streams
if such a limit was announced, or of the number of streams before the
highest ID. Now it is possible to accurately know how many streams
can be allocated, and the number of failed outgoing streams has dropped
in half.

This must be backported to 1.9.
src/mux_h2.c