]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mworker/cli: show master startup logs in recovery mode
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Fri, 18 Oct 2024 18:25:34 +0000 (20:25 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 24 Oct 2024 09:32:20 +0000 (11:32 +0200)
When master enters in recovery mode after unsuccessfull reload
HAPROXY_LOAD_SUCCESS should be set as 0. Like this
cli_io_handler_show_cli_sock() could dump in master CLI its warnings and alerts,
saved in startup logs ring.

No need to backport this fix, as this is related to the previous patches in
this version to refactor master-worker architecture.

src/haproxy.c

index 9107a14de2b88e8d41661fec5212858046d27478..e8b688f1ee6d3e3d543c3b79b12e37489a63e146 100644 (file)
@@ -3030,6 +3030,11 @@ static void run_master_in_recovery_mode(int argc, char **argv)
 {
        struct mworker_proc *proc;
 
+       /* HAPROXY_LOAD_SUCCESS is checked in cli_io_handler_show_cli_sock() to
+        * dump master startup logs with its alerts/warnings via master CLI sock.
+        */
+       setenv("HAPROXY_LOAD_SUCCESS", "0", 1);
+
        /* increment the number failed reloads */
        list_for_each_entry(proc, &proc_list, list) {
                proc->failedreloads++;