From 123f1f6441dfd42eaf704a115dcc671f194eb16a Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 11 Sep 2018 10:06:29 +0200 Subject: [PATCH] MEDIUM: mworker: call per_thread deinit in mworker_reload() 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/haproxy.c b/src/haproxy.c index d5345baa50..b99334148e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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); -- 2.47.3