]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: fd: support stopping FDs during starting
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 16:56:48 +0000 (18:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 18:16:30 +0000 (20:16 +0200)
commit9baff4ffd96824b7db779ea7ce369e7416c15cad
treec1dbf1d8fc140b6ccf361b169b8e62d1b4d09a97
parent88c4c14050451858f1f3cb0169ae900b97e900c4
MEDIUM: fd: support stopping FDs during starting

There's a nasty case during boot, which is the master process. It stops
all listeners from the main thread, and as such we're seeing calls to
fd_delete() from a thread that doesn't match the FD's mask, but more
importantly from a group that doesn't match either. Fortunately this
happens in a process that doesn't see the threads creation, so the FDs
are left intact in the table and we can overwrite the tgid there.

The approach is ugly, it probably shows that we should use a dummy
value for the tgid during boot, that would be replaced once the FDs
migrate to their target, but we also need a way to make sure not to
miss them. Also that doesn't solve the possibility of closing a
listener at run time from the wrong thread group.
src/fd.c