mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: mworker: display an alert upon a wait-mode exit
When the mworker wait mode fails it does an exit, but there is no error message which says it exits. Add a message which specify that the error is non-recoverable. Could be backported in 2.7 and possibly earlier branch.
This commit is contained in:
parent
5fa29b8a74
commit
40db4ae8bb
@ -877,6 +877,17 @@ void reexec_on_failure()
|
|||||||
mworker_reexec_waitmode();
|
mworker_reexec_waitmode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Exit with an error message upon a wait-mode failure.
|
||||||
|
*/
|
||||||
|
void exit_on_waitmode_failure()
|
||||||
|
{
|
||||||
|
if (!atexit_flag)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ha_alert("Non-recoverable mworker wait-mode error, exiting.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* upon SIGUSR1, let's have a soft stop. Note that soft_stop() broadcasts
|
* upon SIGUSR1, let's have a soft stop. Note that soft_stop() broadcasts
|
||||||
@ -1970,10 +1981,17 @@ static void init(int argc, char **argv)
|
|||||||
global.mode &= ~MODE_MWORKER;
|
global.mode &= ~MODE_MWORKER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((global.mode & (MODE_MWORKER | MODE_CHECK | MODE_CHECK_CONDITION)) == MODE_MWORKER &&
|
/* set the atexit functions when not doing configuration check */
|
||||||
(getenv("HAPROXY_MWORKER_REEXEC") != NULL)) {
|
if (!(global.mode & (MODE_CHECK | MODE_CHECK_CONDITION))
|
||||||
|
&& (getenv("HAPROXY_MWORKER_REEXEC") != NULL)) {
|
||||||
|
|
||||||
|
if (global.mode & MODE_MWORKER) {
|
||||||
atexit_flag = 1;
|
atexit_flag = 1;
|
||||||
atexit(reexec_on_failure);
|
atexit(reexec_on_failure);
|
||||||
|
} else if (global.mode & MODE_MWORKER_WAIT) {
|
||||||
|
atexit_flag = 1;
|
||||||
|
atexit(exit_on_waitmode_failure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (change_dir && chdir(change_dir) < 0) {
|
if (change_dir && chdir(change_dir) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user