From dafde43966c1029581d0dd065b368d3db7cbe41e Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 23 Mar 2022 17:01:21 +0900 Subject: [PATCH] Wrap Windows dump process with a new thread In order not to block the waiting thread. Signed-off-by: Daijiro Fukuda --- lib/fluent/supervisor.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index ff73bf04fb..f9e961c126 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -326,7 +326,13 @@ def supervisor_dump_handler_for_windows # but for backward compatibility, this handler is currently for a Windows-only. raise "[BUG] This function is for Windows ONLY." unless Fluent.windows? - FluentSigdump.dump_windows + Thread.new do + begin + FluentSigdump.dump_windows + rescue => e + $log.error "failed to dump: #{e}" + end + end send_signal_to_workers(:CONT) rescue => e @@ -988,9 +994,13 @@ def reload_config end def dump - FluentSigdump.dump_windows - rescue => e - $log.error("failed to dump: #{e}") + Thread.new do + begin + FluentSigdump.dump_windows + rescue => e + $log.error("failed to dump: #{e}") + end + end end def logging_with_console_output