]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: threads/peers: decrement, not increment jobs on quitting
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Nov 2017 13:49:30 +0000 (14:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Nov 2017 13:51:20 +0000 (14:51 +0100)
Commit 8d8aa0d ("MEDIUM: threads/listeners: Make listeners thread-safe")
mistakenly placed HA_ATOMIC_ADD(job, 1) to replace a job--, so it maintains
the job count too high preventing the process from cleanly exiting on
reload.

This needs to be backported to 1.8.

src/peers.c

index d8542415fd4520f10d45534a911c0b3a94b0871e..7580742f7df066240252c441e5fce33bdaeb0b26 100644 (file)
@@ -2102,7 +2102,7 @@ static struct task *process_peer_sync(struct task * task)
                if (ps->flags & PEER_F_TEACH_COMPLETE) {
                        if (peers->flags & PEERS_F_DONOTSTOP) {
                                /* resync of new process was complete, current process can die now */
-                               HA_ATOMIC_ADD(&jobs, 1);
+                               HA_ATOMIC_SUB(&jobs, 1);
                                peers->flags &= ~PEERS_F_DONOTSTOP;
                                for (st = ps->tables; st ; st = st->next)
                                        st->table->syncing--;