MINOR: mworker: report explicitly when worker exits due to max reloads

It's convienient for testing and for usage to produce different warning
messages, when the former worker exits due to max reloads exceeded, and when it
was terminated by the master.
This commit is contained in:
Valentine Krasnobaeva 2024-10-11 19:42:23 +02:00 committed by Willy Tarreau
parent 4c8303a59e
commit d11dc11e5a

View File

@ -417,7 +417,10 @@ void mworker_catch_sigchld(struct sig_handler *sh)
exitcode = status; exitcode = status;
} else { } else {
if (child->options & PROC_O_TYPE_WORKER) { if (child->options & PROC_O_TYPE_WORKER) {
ha_warning("Former worker (%d) exited with code %d (%s)\n", exitpid, status, (status >= 128) ? strsignal(status - 128) : "Exit"); if (child->reloads > max_reloads)
ha_warning("Former worker (%d) exited with code %d (%s), as it exceeds max reloads (%d)\n", exitpid, status, (status >= 128) ? strsignal(status - 128) : "Exit", max_reloads);
else
ha_warning("Former worker (%d) exited with code %d (%s)\n", exitpid, status, (status >= 128) ? strsignal(status - 128) : "Exit");
/* Delete fd from poller fdtab, which will close it */ /* Delete fd from poller fdtab, which will close it */
fd_delete(child->ipc_fd[0]); fd_delete(child->ipc_fd[0]);
delete_oldpid(exitpid); delete_oldpid(exitpid);