Fix Sidekiq process group killing
This commit is contained in:
parent
7bbdb2a29f
commit
12bc7e0bab
2 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue