]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mworker: also close peers sockets in the master
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Dec 2017 10:14:12 +0000 (11:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Dec 2017 10:14:08 +0000 (11:14 +0100)
commit473cf5d0cd2e950da7266bf88518442b583b66d7
treec2da58fcab4353d2d4cf4eaf7bead3a62481d0c6
parentc61c0b371bebe0619cf4628b60b7c79d19e97269
BUG/MEDIUM: mworker: also close peers sockets in the master

There's a nasty case related to signaling all processes via SIGUSR1.
Since the master process still holds the peers sockets, the old process
trying to connect to the new one to teach it its tables has a risk to
connect to the master instead, which will not do anything, causing the
old process to hang instead of quitting.

This patch ensures we correctly close the peers in the master process
on startup, just like it is done for proxies. Ultimately we would rather
have a complete list of listeners to avoid such issues. But that's a bit
trickier as it would require using unbind_all() and avoiding side effects
the master could cause to other processes (like unlinking unix sockets).

To be backported to 1.8.
src/haproxy.c