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

Send signal to all workes #1642

Merged
merged 1 commit into from
Jul 27, 2017
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
22 changes: 13 additions & 9 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,22 @@ def supervisor_sigusr1_handler
log.reopen!
end

if pid = config[:worker_pid]
Process.kill(:USR1, pid)
# don't rescue Erro::ESRSH here (invalid status)
if config[:worker_pid]
config[:worker_pid].each do |pid|
Process.kill(:USR1, pid)
# don't rescue Erro::ESRSH here (invalid status)
end
end
end

def kill_worker
if pid = config[:worker_pid]
if Fluent.windows?
Process.kill :KILL, pid
else
Process.kill :TERM, pid
if config[:worker_pid]
config[:worker_pid].each do |pid|
if Fluent.windows?
Process.kill :KILL, pid
else
Process.kill :TERM, pid
end
end
end
end
Expand All @@ -198,7 +202,7 @@ def spawn(process_manager)
end

def after_start
config[:worker_pid] = @pm.pid
(config[:worker_pid] ||= []).push(@pm.pid)
end
end

Expand Down