From d11dc11e5a385ccf103c69b215214726ff15f892 Mon Sep 17 00:00:00 2001 From: Valentine Krasnobaeva Date: Fri, 11 Oct 2024 19:42:23 +0200 Subject: [PATCH] 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. --- src/mworker.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mworker.c b/src/mworker.c index 874bfd1f6..29bf80cbf 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -417,7 +417,10 @@ restart_wait: exitcode = status; } else { 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 */ fd_delete(child->ipc_fd[0]); delete_oldpid(exitpid);