]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mworker: call per_thread deinit in mworker_reload()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 11 Sep 2018 08:06:29 +0000 (10:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Sep 2018 08:23:24 +0000 (10:23 +0200)
We need to clean the FDs registered manually in the poller to avoid FD
leaking during a reload of the master.

This patch call the per thread deinit function which close the thread
waker pipe.

src/haproxy.c

index d5345baa50f1c0abb121868cd435840d60dd1a0e..b99334148e304693eb537835cf81df6550dfaaff 100644 (file)
@@ -740,8 +740,13 @@ static void mworker_reload()
                next_argv[next_argc++] = NULL;
        }
 
-       if (getenv("HAPROXY_MWORKER_WAIT_ONLY") == NULL)
+       if (getenv("HAPROXY_MWORKER_WAIT_ONLY") == NULL) {
+               struct per_thread_deinit_fct *ptdf;
+
+               list_for_each_entry(ptdf, &per_thread_deinit_list, list)
+                       ptdf->fct();
                deinit_pollers(); /* we don't want to leak the poller fd */
+       }
 
        ha_warning("Reexecuting Master process\n");
        execvp(next_argv[0], next_argv);