Commit 12bc7e0b authored by Nick Thomas's avatar Nick Thomas

Fix Sidekiq process group killing

parent 7bbdb2a2
...@@ -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