From 775e00158ae51969f95ed5108f5dc648c9c3f448 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Sep 2020 16:36:26 +0200 Subject: [PATCH] MAJOR: signals: use protocol_pause_all() and protocol_resume_all() When temporarily pausing the listeners with SIG_TTOU, we now pause all listeners via the protocols instead of the proxies. This has the benefits that listeners are paused regardless of whether or not they belong to a visible proxy. And for resuming via SIG_TTIN we do the same, which allows to report binding conflicts and address them, since the operation can be repeated on a per-listener basis instead of a per-proxy basis. While in appearance all cases were properly handled, it's impossible to completely rule out the possibility that something broken used to work by luck due to the scan ordering which is naturally different, hence the major tag. --- src/haproxy.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index f256dd871..3f8e71ee6 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -934,7 +934,12 @@ static void sig_soft_stop(struct sig_handler *sh) */ static void sig_pause(struct sig_handler *sh) { - pause_proxies(); + if (protocol_pause_all() & ERR_FATAL) { + const char *msg = "Some proxies refused to pause, performing soft stop now.\n"; + ha_warning(msg); + send_log(NULL, LOG_WARNING, msg); + soft_stop(); + } pool_gc(NULL); } @@ -943,7 +948,11 @@ static void sig_pause(struct sig_handler *sh) */ static void sig_listen(struct sig_handler *sh) { - resume_proxies(); + if (protocol_resume_all() & ERR_FATAL) { + const char *msg = "Some proxies refused to resume, probably due to a conflict on a listening port. You may want to try again after the conflicting application is stopped, otherwise a restart might be needed to resume safe operations.\n"; + ha_warning(msg); + send_log(NULL, LOG_WARNING, msg); + } } /*