MEDIUM: listeners: make unbind_listener() converge if needed
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2020 14:24:23 +0000 (16:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:29 +0000 (11:27 +0200)
commitb6607bfaf07d22feecbb7013e73a9bfb1d970f76
tree3fa2bf600a4862267a6d32a5613f434d95126211
parent02b092f00606c9de3a8f315831d274f93ffa4f08
MEDIUM: listeners: make unbind_listener() converge if needed

The ZOMBIE state on listener is a real mess. Listeners passing through
this state have lost their consistency with the proxy AND with the fdtab.
Plus this state is not used for all foreign listeners, only for those
belonging to a proxy that entirely runs on another process, otherwise it
stays in INIT state, which makes the usefulness extremely questionable.
But the real issue is that it's impossible to untangle the receivers
from the proxy state as long as we have this because of deinit()...

So what we do here is to start by making unbind_listener() support being
called more than once. This will permit to call it again to really close
the FD and finish the operations if it's called with an FD that's in a
fake state (such as INIT but with a valid fd).
src/listener.c