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 ...@@ -35,8 +35,11 @@ module Gitlab
# signals from outside the process group, but that isn't fatal. # signals from outside the process group, but that isn't fatal.
def self.blindly_signal_pgroup!(signal) def self.blindly_signal_pgroup!(signal)
old_trap = trap(signal, 'IGNORE') old_trap = trap(signal, 'IGNORE')
Process.kill(signal, "-#{Process.getpgrp}") begin
trap(signal, old_trap) Process.kill(signal, 0)
ensure
trap(signal, old_trap)
end
end end
end end
end end
...@@ -44,7 +44,7 @@ describe Gitlab::SidekiqSignals do ...@@ -44,7 +44,7 @@ describe Gitlab::SidekiqSignals do
expect(Process) expect(Process)
.to receive(:kill) .to receive(:kill)
.with(signal, "-#{Process.pid}") .with(signal, 0)
.ordered .ordered
expect(described_class) 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