Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Comment on lines -563 to -567
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions will be called

fluent-bit/src/fluent-bit.c

Lines 1348 to 1352 in 824ba3d

cf_opts = flb_cf_context_get();
if (cf_opts != NULL) {
flb_cf_destroy(cf_opts);
}

and

fluent-bit/src/fluent-bit.c

Lines 1364 to 1365 in 824ba3d

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