]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h1: fix the open streams counter on stream creation failure
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 08:59:17 +0000 (10:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:10:26 +0000 (19:10 +0200)
commitf0d20d41d9bbb38220c0103c91efcff46e9c1296
tree36604d518741a351965960990186bcef84d59d3e
parent31c153983ee0bbfeb40adacf9acfad552910bd51
BUG/MINOR: mux-h1: fix the open streams counter on stream creation failure

The "h1_open_streams" stats counter is incremented at the end of
h1c_frt_stream_new() and h1c_bck_stream_new(), and decremented in
h1s_destroy(). But when the stream connector attachment or the sedesc
allocation fails after h1s_new() succeeded, h1s_destroy() is called on the
error path and decrements the counter which was not incremented. The gauge
then drifts and may become negative.

The counter is now incremented in h1s_new() as soon as the H1 stream is
allocated, so that it is always balanced by h1s_destroy(). The total streams
counter is left where it was so that it only counts successfully created
streams.

This patch may be backported to all supported versions.
src/mux_h1.c