]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: errors: also call deinit_errors_buffers() on deinit()
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 15:50:53 +0000 (17:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 15:50:53 +0000 (17:50 +0200)
Tim reported in issue #1676 that we don't release startup logs if we
warn during startup and quit before creating threads (e.g. -c -f ...).
Let's subscribe deinit_errors_buffers() to both thread's end and
deinit. That's OK since it uses both per-thread and global variables,
and is idempotent.

src/errors.c

index 993b6ae58284434e204ba3b06f7fd85bd752d672..109ec0aaaee829333f7d73f6225902e4dd3045cc 100644 (file)
@@ -375,4 +375,6 @@ static void deinit_errors_buffers()
        ha_free(&usermsgs_ctx.str.area);
 }
 
+/* errors might be used in threads and even before forking, thus 2 deinit */
 REGISTER_PER_THREAD_FREE(deinit_errors_buffers);
+REGISTER_POST_DEINIT(deinit_errors_buffers);