Skip to content

Commit

Permalink
fluent-bit: modify hot reload handler (#8041)
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored Oct 19, 2023
1 parent 92b9053 commit 0955615
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/fluent-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ static void flb_signal_handler_status_line(struct flb_cf *cf_opts)
char s[] = "[engine] caught signal (";
time_t now;
struct tm *cur;
flb_ctx_t *ctx = flb_context_get();

now = time(NULL);
cur = localtime(&now);
Expand Down Expand Up @@ -609,9 +608,6 @@ static void flb_signal_handler(int signal)
#ifndef FLB_HAVE_STATIC_CONF
if (flb_bin_restarting == FLB_RELOAD_IDLE) {
flb_bin_restarting = FLB_RELOAD_IN_PROGRESS;
/* reload by using same config files/path */
flb_reload(ctx, cf_opts);
flb_bin_restarting = FLB_RELOAD_IDLE;
}
else {
flb_utils_error(FLB_ERR_RELOADING_IN_PROGRESS);
Expand Down Expand Up @@ -1396,12 +1392,18 @@ int flb_main(int argc, char **argv)
#ifdef FLB_SYSTEM_WINDOWS
flb_console_handler_set_ctx(ctx, cf_opts);
#endif
if (flb_bin_restarting == FLB_RELOAD_IN_PROGRESS) {
/* reload by using same config files/path */
flb_reload(ctx, cf_opts);
ctx = flb_context_get();
flb_bin_restarting = FLB_RELOAD_IDLE;
}
}

if (exit_signal) {
flb_signal_exit(exit_signal);
}
ret = config->exit_status_code;
ret = ctx->config->exit_status_code;

cf_opts = flb_cf_context_get();

Expand Down

0 comments on commit 0955615

Please sign in to comment.