BUG/MEDIUM: listener: make the master also keep workers' inherited FDs
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 17:38:05 +0000 (18:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2020 13:22:42 +0000 (14:22 +0100)
commit22ccd5ebaf10318f73ef9b9f999feebce6bc1f7f
treebc6f4142d9b5c376815967dcf9e766be25e2fa59
parent59b5da487368a976fa475848eaea5499ca007a19
BUG/MEDIUM: listener: make the master also keep workers' inherited FDs

In commit 374e9af35 ("MEDIUM: listener: let do_unbind_listener() decide
whether to close or not") it didn't appear necessary to have the master
process keep open the workers' inherited FDs. But this is actually
necessary to handle the reload on "bind fd@foo" situations, otherwise
the FD may be reassigned and the new socket cannot be set up, sometimes
causing "socket operation on non-socket" or other types of errors.

William found that this was the cause for the consistent failures of the
abns regtest, which already used to fail very often before this and was
as such marked as broken.

Interestingly I didn't have this issue with my test configs because
the FD number I used was higher and within the range of other listening
sockets. But this means that one of these wouldn't work as expected.

No backport is needed, this was introduced as part of the listeners
rework in 2.3.
src/sock.c