From: Valentine Krasnobaeva Date: Fri, 11 Oct 2024 17:42:23 +0000 (+0200) Subject: MINOR: mworker: report explicitly when worker exits due to max reloads X-Git-Tag: v3.1-dev10~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d11dc11e5a385ccf103c69b215214726ff15f892;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/mworker.c b/src/mworker.c index 874bfd1f62..29bf80cbf4 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);