Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a potential bug that ThreadError may occur on SIGUSR1 #2678

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def supervisor_sigusr1_handler
if log = config[:logger_initializer]
# Creating new thread due to mutex can't lock
# in main thread during trap context
Thread.new {
Thread.new do
log.reopen!
}.run
end
end

if config[:worker_pid]
Expand Down Expand Up @@ -721,7 +721,7 @@ def install_main_process_signal_handlers
def flush_buffer
# Creating new thread due to mutex can't lock
# in main thread during trap context
Thread.new {
Thread.new do
begin
$log.debug "fluentd main process get SIGUSR1"
$log.info "force flushing buffered events"
Expand All @@ -731,7 +731,7 @@ def flush_buffer
rescue Exception => e
$log.warn "flushing thread error: #{e}"
end
}.run
end
end

def logging_with_console_output
Expand Down