]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: Properly handle shutdown when trying to get a line
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Jan 2026 10:12:00 +0000 (11:12 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Jan 2026 12:46:57 +0000 (13:46 +0100)
When a shutdown was reported to a peer applet, the event was not properly
handled if it failed to receive data. The function responsible to get data
was exiting too early if the applet buffer was empty, without testing the
sedesc status. Because of this issue, it was possible to have frozen peer
applets. For instance, it happend on client timeout. With too many frozen
applets, it was possible to reach the maxconn.

This patch should fix the issue #3234. It must be backported to 3.3.

src/peers.c

index cd68b04c40ccb1c35f9a0abdc449be184cbc5e4b..1d5b0bfd1837fc9fa7a45ec970bd9bbe9bebf99c 100644 (file)
@@ -1212,7 +1212,7 @@ static inline int peer_getline(struct appctx  *appctx)
        int n = 0;
 
        TRACE_ENTER(PEERS_EV_SESS_IO|PEERS_EV_RX_MSG, appctx);
-       if (applet_get_inbuf(appctx) == NULL || !applet_input_data(appctx)) {
+       if (applet_get_inbuf(appctx) == NULL) {
                applet_need_more_data(appctx);
                goto out;
        }