]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: FD leak of the eventpoll in wait mode
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 25 Nov 2021 09:03:44 +0000 (10:03 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 25 Nov 2021 09:45:29 +0000 (10:45 +0100)
Since 2.5, before re-executing in wait mode, the master can have a
working configuration loaded, with a eventpoll fd. This case was not
handled correctly and a new eventpoll FD is leaking in the master at
each reload, which is inherited by the new worker.

Must be backported in 2.5.

src/haproxy.c

index 4dbb283a7853486b593aed83e2eb493dc3efd270..094a8393a16946bdf8407e6f3497971dc27c5c91 100644 (file)
@@ -683,13 +683,11 @@ static void mworker_reexec()
        /* close the listeners FD */
        mworker_cli_proxy_stop();
 
-       if (getenv("HAPROXY_MWORKER_WAIT_ONLY") == NULL) {
-               /* close the poller FD and the thread waker pipe FD */
-               list_for_each_entry(ptdf, &per_thread_deinit_list, list)
-                       ptdf->fct();
-               if (fdtab)
-                       deinit_pollers();
-       }
+       /* close the poller FD and the thread waker pipe FD */
+       list_for_each_entry(ptdf, &per_thread_deinit_list, list)
+               ptdf->fct();
+       if (fdtab)
+               deinit_pollers();
 #ifdef HAVE_SSL_RAND_KEEP_RANDOM_DEVICES_OPEN
        /* close random device FDs */
        RAND_keep_random_devices_open(0);