diff --git a/src/flb_input.c b/src/flb_input.c index 204e164aeec..6c77cac6c6c 100644 --- a/src/flb_input.c +++ b/src/flb_input.c @@ -144,6 +144,7 @@ int flb_input_log_check(struct flb_input_instance *ins, int l) void flb_input_init() { FLB_TLS_INIT(in_collect_params); + FLB_TLS_SET(in_collect_params, NULL); } void flb_input_exit() diff --git a/src/flb_output.c b/src/flb_output.c index b1548f60dfa..cbc39f74512 100644 --- a/src/flb_output.c +++ b/src/flb_output.c @@ -45,6 +45,7 @@ FLB_TLS_DEFINE(struct flb_out_flush_params, out_flush_params); void flb_output_prepare() { FLB_TLS_INIT(out_flush_params); + FLB_TLS_SET(out_flush_params, NULL); } /* Validate the the output address protocol */ diff --git a/tests/runtime/custom_calyptia_test.c b/tests/runtime/custom_calyptia_test.c index 5ad30e7a0bf..101b1386c76 100644 --- a/tests/runtime/custom_calyptia_test.c +++ b/tests/runtime/custom_calyptia_test.c @@ -19,6 +19,9 @@ void flb_custom_calyptia_pipeline_config_get_test() ctx = flb_create(); flb_service_set(ctx, "flush", "1", "grace", "1", NULL); + flb_input_init(); + flb_output_prepare(); + in_ffd_dummy = flb_input(ctx, (char *) "dummy", NULL); TEST_CHECK(in_ffd_dummy >= 0); @@ -46,8 +49,6 @@ void flb_custom_calyptia_pipeline_config_get_test() cfg = custom_calyptia_pipeline_config_get(ctx->config); TEST_CHECK(strcmp(cfg, cfg_str) == 0); - // fix a thread local storage bug on macos - flb_output_prepare(); flb_sds_destroy(cfg); flb_destroy(ctx); }