]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mworker: report explicitly when worker exits due to max reloads
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Fri, 11 Oct 2024 17:42:23 +0000 (19:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
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

index 874bfd1f62b199e7f63fd8e42985415ad8220cf1..29bf80cbf4a6d730e558575174ebf5564d8a3ff7 100644 (file)
@@ -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);