summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-24 16:36:26 +0200
committerWilly Tarreau <w@1wt.eu>2020-10-07 18:45:03 +0200
commit69c7cf7a6a82be1986cb7966fba4257ab7600319 (patch)
tree01089ba1dc00038769774bd009269d7b151e20fd
parent8faf1bc232ff17e8227f7dce70e67bace11fcde5 (diff)
downloadhaproxy-69c7cf7a6a82be1986cb7966fba4257ab7600319.tar.gz
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.
-rw-r--r--src/haproxy.c13
1 files 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);
+ }
}
/*