BUG/MINOR: mux-spop: Don't report error for stream if ACK was already received
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 May 2025 16:05:26 +0000 (18:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:43 +0000 (17:01 +0200)
When a SPOP connection was closed or was in error, an error was
systematically reported on all its SPOP streams. However, SPOP streams that
already received their ACK frame must be excluded. Otherwise if an agent
sends a ACK and close immediately, the ACK will be ignored because the SPOP
stream will handle the error first.

This patch must be backported to 3.1.

(cherry picked from commit 6d68beace5435f24abc4292f22021e4465b4dcee)
Signed-off-by: Willy Tarreau <w@1wt.eu>

src/mux_spop.c

index e1863e4..388076a 100644 (file)
@@ -1272,7 +1272,7 @@ static void spop_strm_wake_one_stream(struct spop_strm *spop_strm)
                        spop_strm_close(spop_strm);
        }
 
-       if (spop_conn->state == SPOP_CS_CLOSED || (spop_conn->flags & (SPOP_CF_ERR_PENDING|SPOP_CF_ERROR))) {
+       if (!(spop_strm->flags & SPOP_SF_ACK_RCVD) && (spop_conn->state == SPOP_CS_CLOSED || (spop_conn->flags & (SPOP_CF_ERR_PENDING|SPOP_CF_ERROR)))) {
                se_fl_set_error(spop_strm->sd);
                spop_strm_propagate_term_flags(spop_conn, spop_strm);
                if (!spop_strm->sd->abort_info.info) {