Skip to content

Commit f0f03b9

Browse files
einval22wlallemand
authored andcommitted
BUG/MINOR: errors: print_message: don't allocate startup logs ring
Don't call startup_logs_init() in order to allocate the startup logs ring again, if startup_logs pointer is NULL. Startup logs ring is allocated explicitly in step_init_1 routine, when the process starts, and it's freed explicitly for master process at the end of mworker_reexec scope. So, when we no longer have this pointer, let's just save the log message in the message buffer. Otherwise, in case of master process, we will allocate the startup logs ring again here and we will lost its address after execvp. No need to backport this fix as it's related to the latest master-worker refactoring.
1 parent bf8c871 commit f0f03b9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/errors.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ static void print_message(int use_usermsgs_ctx, const char *label, const char *f
340340
}
341341

342342
if (global.mode & MODE_STARTING) {
343-
if (unlikely(!startup_logs))
344-
startup_logs_init();
345-
346343
if (likely(startup_logs)) {
347344
struct ist m[3];
348345

@@ -351,7 +348,8 @@ static void print_message(int use_usermsgs_ctx, const char *label, const char *f
351348
m[2] = msg_ist;
352349

353350
ring_write(startup_logs, ~0, 0, 0, m, 3);
354-
}
351+
} else
352+
usermsgs_put(&msg_ist);
355353
}
356354
else {
357355
usermsgs_put(&msg_ist);

0 commit comments

Comments
 (0)