]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proto: stop protocols under thread isolation during soft stop
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 17:15:02 +0000 (19:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 17:43:10 +0000 (19:43 +0200)
commit1b927eb3c35dfdbe73b4852f18e025b8e10e3716
treecfaf33798a70d31964e534acf565cb7d1c73f6ae
parent7aa41196cfd288769d47de1d0ec20008ed85aa81
MEDIUM: proto: stop protocols under thread isolation during soft stop

protocol_stop_now() is called from do_soft_stop_now() running on any
thread that received the signal. The problem is that it will call some
listener handlers to close the FD, resulting in an fd_delete() being
called from the wrong group. That's not clean and we cannot even rely
on the thread mask to show up.

One interesting long-term approach could be to have kill queues for
FDs, and maybe we'll need them in the long run. However that doesn't
work well for listeners in this situation.

Let's simply isolate ourselves during this instant. We know we'll be
alone dealing with the close and that the FD will be instantly deleted
since not in use by any other thread. It's not the cleanest solution
but it should last long enough without causing trouble.
src/proxy.c