Skip to content

Commit

Permalink
bin: remove cleanup code from flb_signal_exit (#7735)
Browse files Browse the repository at this point in the history
- remove cleanup code from flb_signal_exit
- release trace_props

Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored Jul 25, 2023
1 parent 659a4db commit 1d83649
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions src/fluent-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ static void flb_signal_exit(int signal)
char s[] = "[engine] caught signal (";
time_t now;
struct tm *cur;
flb_ctx_t *ctx = flb_context_get();
struct flb_cf *cf_opts = flb_cf_context_get();

now = time(NULL);
cur = localtime(&now);
Expand All @@ -550,25 +548,6 @@ static void flb_signal_exit(int signal)
flb_print_signal(SIGTERM);
flb_print_signal(SIGSEGV);
};

/* Signal handlers */
/* SIGSEGV is not handled here to preserve stacktrace */
switch (signal) {
case SIGINT:
case SIGTERM:
#ifndef FLB_SYSTEM_WINDOWS
case SIGQUIT:
case SIGHUP:
#endif
if (cf_opts != NULL) {
flb_cf_destroy(cf_opts);
}
flb_stop(ctx);
flb_destroy(ctx);
_exit(EXIT_SUCCESS);
default:
break;
}
}

static void flb_signal_handler(int signal)
Expand Down Expand Up @@ -1359,6 +1338,10 @@ int flb_main(int argc, char **argv)
if (trace_output) {
flb_free(trace_output);
}
if (trace_props != NULL) {
flb_kv_release(trace_props);
flb_free(trace_props);
}
#endif

flb_stop(ctx);
Expand Down

0 comments on commit 1d83649

Please sign in to comment.