Commit 2b86f45c authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-sidekiq-process-group-killing' into 'master'

Fix Sidekiq process group killing

See merge request gitlab-org/gitlab-ce!25866
parents 5cea1e8b 12bc7e0b
......@@ -35,8 +35,11 @@ module Gitlab
# signals from outside the process group, but that isn't fatal.
def self.blindly_signal_pgroup!(signal)
old_trap = trap(signal, 'IGNORE')
Process.kill(signal, "-#{Process.getpgrp}")
trap(signal, old_trap)
begin
Process.kill(signal, 0)
ensure
trap(signal, old_trap)
end
end
end
end
......@@ -44,7 +44,7 @@ describe Gitlab::SidekiqSignals do
expect(Process)
.to receive(:kill)
.with(signal, "-#{Process.pid}")
.with(signal, 0)
.ordered
expect(described_class)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment