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

Fix Sidekiq process group killing

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