Skip to content

Commit

Permalink
reload: do not call flb_stop when flb_start fails and fix crash on RHEL
Browse files Browse the repository at this point in the history
This is a backport to 3.1 of #9432.

Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan authored and edsiper committed Sep 27, 2024
1 parent 679216d commit 9736f10
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/flb_reload.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ int flb_reload(flb_ctx_t *ctx, struct flb_cf *cf_opts)
flb_sds_destroy(file);
}
flb_cf_destroy(new_cf);
flb_stop(new_ctx);
flb_destroy(new_ctx);
flb_error("[reload] reloaded config is invalid. Reloading is halted");

Expand All @@ -488,7 +487,6 @@ int flb_reload(flb_ctx_t *ctx, struct flb_cf *cf_opts)
if (ret != 0) {
flb_sds_destroy(file);
flb_cf_destroy(new_cf);
flb_stop(new_ctx);
flb_destroy(new_ctx);

flb_error("[reload] reloaded config format is invalid. Reloading is halted");
Expand All @@ -501,7 +499,6 @@ int flb_reload(flb_ctx_t *ctx, struct flb_cf *cf_opts)
if (ret != 0) {
flb_sds_destroy(file);
flb_cf_destroy(new_cf);
flb_stop(new_ctx);
flb_destroy(new_ctx);

flb_error("[reload] reloaded config is invalid. Reloading is halted");
Expand Down Expand Up @@ -530,7 +527,6 @@ int flb_reload(flb_ctx_t *ctx, struct flb_cf *cf_opts)
ret = flb_start(new_ctx);

if (ret != 0) {
flb_stop(new_ctx);
flb_destroy(new_ctx);

flb_error("[reload] loaded configuration contains error(s). Reloading is aborted");
Expand Down

0 comments on commit 9736f10

Please sign in to comment.