Skip to content

Commit

Permalink
Send signal to all workes
Browse files Browse the repository at this point in the history
  • Loading branch information
sovioletta committed Jul 25, 2017
1 parent e9709fb commit ed5f0cb
Showing 1 changed file with 13 additions and 9 deletions.
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

0 comments on commit ed5f0cb

Please sign in to comment.