From 22ccd5ebaf10318f73ef9b9f999feebce6bc1f7f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 3 Nov 2020 18:38:05 +0100 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sock.c b/src/sock.c index d640190..192559b 100644 --- a/src/sock.c +++ b/src/sock.c @@ -212,6 +212,7 @@ void sock_unbind(struct receiver *rx) * - worker process unbinding from a worker's FD with socket transfer enabled => keep * - master process unbinding from a master's inherited FD => keep * - master process unbinding from a master's FD => close + * - master process unbinding from a worker's inherited FD => keep * - master process unbinding from a worker's FD => close * - worker process unbinding from a master's FD => close * - worker process unbinding from a worker's FD => close @@ -225,7 +226,6 @@ void sock_unbind(struct receiver *rx) return; if (!stopping && master && - rx->flags & RX_F_MWORKER && rx->flags & RX_F_INHERITED) return; -- 1.7.10.4