diff --git a/src/haproxy.c b/src/haproxy.c index df8d34e740..bd8608f74a 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -555,8 +555,24 @@ static void mworker_cleanlisteners() { struct listener *l, *l_next; struct proxy *curproxy; + struct peers *curpeers; for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) { + /* we might have to unbind some peers sections from some processes */ + for (curpeers = cfg_peers; curpeers; curpeers = curpeers->next) { + if (!curpeers->peers_fe) + continue; + + stop_proxy(curpeers->peers_fe); + /* disable this peer section so that it kills itself */ + signal_unregister_handler(curpeers->sighandler); + task_delete(curpeers->sync_task); + task_free(curpeers->sync_task); + curpeers->sync_task = NULL; + task_free(curpeers->peers_fe->task); + curpeers->peers_fe->task = NULL; + curpeers->peers_fe = NULL; + } list_for_each_entry_safe(l, l_next, &curproxy->conf.listeners, by_fe) { /* does not close if the FD is inherited with fd@