MINOR: mworker: adapt exit_on_failure for master recovery mode

Master recovery mode replaces the former wait-mode with a difference, that
master in this case doesn't try to fork the new worker process. But it still
needs to enter to its polling loop in order to monitor the previous worker.
Master performs some initialization steps for this and it recreates its master
CLI. During its initialization steps, master could potentially fail again.
As we use for the moment for master init steps some common routines
(step_init_2() and step_init_3()), there is no way there to signal to user that
failure has happened for the master and in addition, in its recovery mode. So,
in such case exit_on_failure() can be still useful in order to print an
appropriate alert, as we can register this function as atexit handler for the
master.
This commit is contained in:
Valentine Krasnobaeva 2024-10-08 14:17:18 +02:00 committed by Willy Tarreau
parent 6615e46456
commit fe4708feaa

View File

@ -927,14 +927,11 @@ void on_new_child_failure()
}
/*
* Exit with an error message upon a wait-mode failure.
* Exit with an error message upon a master recovery mode failure.
*/
void exit_on_failure()
static void exit_on_failure()
{
if (!atexit_flag)
return;
ha_alert("Non-recoverable mworker wait-mode error, exiting.\n");
ha_alert("Master encountered an error in recovery mode, exiting.\n");
}