Skip to content

Commit

Permalink
input_calytpia_fleet: use flb_config->bin_restarting to signal hot re…
Browse files Browse the repository at this point in the history
…load on windows.

Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Feb 5, 2025
1 parent dd6323f commit 1a99e51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/in_calyptia_fleet/in_calyptia_fleet.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,19 @@ static void *do_reload(void *data)
}
reload->flb->config->conf_path_file = reload->cfg_path;

flb_free(reload);
sleep(5);
#ifndef FLB_SYSTEM_WINDOWS
flb_free(reload);
kill(getpid(), SIGHUP);
#else
GenerateConsoleCtrlEvent(1 /* CTRL_BREAK_EVENT_1 */, 0);
/* using the refactor that placed `bin_restarting` inside
* `flb_config` to use it as a messaging mechanism instead of
* GenerateConsoleCtrlEvent to overcome the fact that windows
* services do not have a console and therefore cannot
* react to console events or handle them (fixes sc-112185).
*/
reload->flb->config->bin_restarting = FLB_RELOAD_IN_PROGRESS;
flb_free(reload);
#endif
return NULL;
}
Expand Down

0 comments on commit 1a99e51

Please sign in to comment.