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.
This commit is contained in:
Willy Tarreau 2020-09-24 16:36:26 +02:00
parent 09819d1118
commit 775e00158a

View File

@ -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);
}
}
/*