]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: Allocate the log buffers before the proxies startup
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 14 Nov 2017 21:02:30 +0000 (22:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 Nov 2017 10:19:46 +0000 (11:19 +0100)
Since the commit cd7879adc ("BUG/MEDIUM: threads: Run the poll loop on the main
thread too"), the log buffers are allocated after the proxies startup. So log
messages produced during this startup was ignored.

To fix the bug, we restore the initialization of these buffers before proxies
startup.

This is specific to threads, no backport is needed.

src/haproxy.c

index 5b45dfbaf6d31de277cd7675914e6e5665de1e92..deec51bf61693b6005e3e3abed23c23109ce5b4f 100644 (file)
@@ -1796,6 +1796,11 @@ static void init(int argc, char **argv)
                exit(1);
        }
 
+       if (!init_log_buffers()) {
+               Alert("failed to initialize log buffers.\n");
+               exit(1);
+       }
+
        /*
         * Note: we could register external pollers here.
         * Built-in pollers have been registered before main().