]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: deinit: close all receivers/listeners before scanning proxies
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2020 14:46:22 +0000 (16:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:29 +0000 (11:27 +0200)
commitae7bc4a237a3c583dd566ae6810b09dce7b07b7b
tree706af5e0085aac77756e50b37a06bbd035afc913
parentb6607bfaf07d22feecbb7013e73a9bfb1d970f76
MEDIUM: deinit: close all receivers/listeners before scanning proxies

Because of the zombie state, proxies have a skewed vision of the state
of listeners, which explains why there are hacks switching the state
from ZOMBIE to INIT in the proxy cleaning loop. This is particularly
complicated and not needed, as all the information is now available
in the protocol list and the fdtab.

What we do here instead is to first close all active listeners or
receivers by protocol and clean their protocol parts. Then we scan the
fdtab to get rid of remaining ones that were necessarily in INIT state
after a previous invocation of delete_listener(). From this point, we
know the listeners are cleaned, the can safely be freed by scanning the
proxies.
src/haproxy.c