From ed5f0cbfdba74a9033cc771cef1b6fa0c187579d Mon Sep 17 00:00:00 2001 From: Jaewon Kwak Date: Tue, 25 Jul 2017 06:54:32 +0000 Subject: [PATCH] Send signal to all workes --- lib/fluent/supervisor.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index c4bdcaef0e..c3d3be713e 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -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 @@ -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