File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -387,12 +387,16 @@ struct flb_reload_watchdog_ctx {
387387
388388static void * hot_reload_watchdog_thread (void * arg )
389389{
390+ int loop_sleep ;
390391 struct flb_reload_watchdog_ctx * ctx = (struct flb_reload_watchdog_ctx * )arg ;
391392
392393 /* Set async cancellation type for (mostly) immediate response to pthread_cancel */
393394 pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS , NULL );
394395
395- flb_time_msleep (ctx -> timeout_seconds * 1000 );
396+ /* loop for each sleep in a busy pattern to avoid delaying flb_reload() */
397+ for (loop_sleep = 0 ; loop_sleep < ctx -> timeout_seconds * 10 ; loop_sleep ++ ) {
398+ flb_time_msleep (100 );
399+ }
396400
397401 flb_error ("[hot_reload_watchdog] Hot reload timeout exceeded (%d seconds), "
398402 "aborting to prevent indefinite hang" , ctx -> timeout_seconds );
@@ -621,7 +625,9 @@ int flb_reload(flb_ctx_t *ctx, struct flb_cf *cf_opts)
621625 new_config -> hot_reload_succeeded = FLB_TRUE ;
622626
623627 /* Cancel the watchdog thread since reload completed successfully */
628+ flb_debug ("[reload] cleanup watchdog" );
624629 flb_reload_watchdog_cleanup (watchdog_ctx );
625630
631+ flb_info ("[reload] successful reload done." );
626632 return 0 ;
627633}
You can’t perform that action at this time.
0 commit comments