Skip to content

Commit

Permalink
Wrap Windows dump process with a new thread
Browse files Browse the repository at this point in the history
In order not to block the waiting thread.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
  • Loading branch information
daipom committed Mar 23, 2022
1 parent 9d0d1f3 commit dafde43
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/fluent/supervisor.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dafde43

Please sign in to comment.