Skip to content

Commit 0e56dd0

Browse files
committed
input_calytpia_fleet: use flb_config->bin_restarting to signal hot reload on windows.
Signed-off-by: Phillip Whelan <[email protected]>
1 parent cb3504d commit 0e56dd0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugins/in_calyptia_fleet/in_calyptia_fleet.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,19 @@ static void *do_reload(void *data)
468468
}
469469
reload->flb->config->conf_path_file = reload->cfg_path;
470470

471-
flb_free(reload);
472471
sleep(5);
473472
#ifndef FLB_SYSTEM_WINDOWS
473+
flb_free(reload);
474474
kill(getpid(), SIGHUP);
475475
#else
476-
GenerateConsoleCtrlEvent(1 /* CTRL_BREAK_EVENT_1 */, 0);
476+
/* using the refactor that placed `bin_restarting` inside
477+
* `flb_config` to use it as a messaging mechanism instead of
478+
* GenerateConsoleCtrlEvent to overcome the fact that windows
479+
* services do not have a console and therefore cannot
480+
* react to console events or handle them (fixes sc-112185).
481+
*/
482+
reload->flb->config->bin_restarting = FLB_RELOAD_IN_PROGRESS;
483+
flb_free(reload);
477484
#endif
478485
return NULL;
479486
}

0 commit comments

Comments
 (0)