]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: peers: make the soft-stop "dont_stop" state per peers section
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Nov 2026 13:12:49 +0000 (14:12 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 17 Nov 2026 13:18:24 +0000 (14:18 +0100)
commitecc4f74ccc2fa048e3ca1a36ad20da745d158ffc
treefe38e83d8b6d05f0f2e67963d6fae4ca5fa42bb5
parent8ff243b2a11c3d9d569fdc5dc8d108f3465eac09
BUG/MEDIUM: peers: make the soft-stop "dont_stop" state per peers section

Commit 608e23c49 ("MINOR: peers: Use a static variable to wait a resync on
reload") replaced the PEERS_F_DONOTSTOP flag with a static variable in
__process_stopping_peer_sync(), considering that it was only used in this
function. But this function is called by the sync task of each peers
section, so the variable is shared between all sections. With more than one
peers section, upon soft-stop, only the first section to process the signal
arms its resync timeout, requests the local reconnect and kills its
sessions; the other ones see dont_stop already set and skip this, so they
never push their tables to the new process. Then the first section which
completes (or times out) decrements jobs and resets the variable, letting
the old process leave without releasing the table refcounts of the other
sections. As a result, on each reload, the stick-tables of all sections but
one are lost.

Let's store this state in the peers section itself.

This fixes GitHub issue #3517. This must be backported to 3.0.
include/haproxy/peers-t.h
src/peers.c