worker_killer 1.1.0.214146 → 1.1.0.214159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/worker_killer/killer/puma.rb +3 -5
- data/spec/killer/puma_spec.rb +2 -2
- metadata +10 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a765c4a2926183623220942f0919ad8f7d83302b7e03140fa8e2509e5639788f
|
|
4
|
+
data.tar.gz: e06fc24c3067f25d03ee1f43ead253330c0a7734e139d8f3678ec42cc2d59e0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a7a69c2c344967413ce45923a07e97bd265ccb6c84a14e6eb18377f3a1c8c791d32360fbc81aa1d0ff8c3e1af0da2d5120d7e003fa9a601383c7a954052de1d
|
|
7
|
+
data.tar.gz: 1da895a3b057fc9b896fa2a0a5d3cf670f1eaafa2b190ccaf5ee3c31080a48ecae93d795d2d46d130700fd106cf3a1a54cef6e2f0adc2b8d462938253fb623b5
|
|
@@ -13,14 +13,12 @@ module ::WorkerKiller
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def do_kill(sig, pid, alive_sec, **_params)
|
|
16
|
-
if
|
|
17
|
-
logger.error "#{self} force to kill self[#{worker_num}] (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
|
|
18
|
-
Process.kill sig, pid
|
|
19
|
-
return
|
|
20
|
-
end
|
|
16
|
+
return if @already_sended == sig
|
|
21
17
|
|
|
22
18
|
logger.warn "#{self} send #{worker_num} to Puma Plugin (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
|
|
23
19
|
|
|
20
|
+
@already_sended = sig
|
|
21
|
+
|
|
24
22
|
Socket.unix(ipc_path) do |sock|
|
|
25
23
|
sock.puts Integer(worker_num).to_s
|
|
26
24
|
end
|
data/spec/killer/puma_spec.rb
CHANGED
|
@@ -20,8 +20,8 @@ RSpec.describe WorkerKiller::Killer::Puma do
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'expect right signal order' do
|
|
23
|
-
expect(Socket).to receive(:unix).with(ipc_path).and_yield(buffer).exactly(
|
|
24
|
-
expect(Process).
|
|
23
|
+
expect(Socket).to receive(:unix).with(ipc_path).and_yield(buffer).exactly(3).times
|
|
24
|
+
expect(Process).not_to receive(:kill)
|
|
25
25
|
|
|
26
26
|
killer.kill(Time.now)
|
|
27
27
|
expect(buffer.string.strip).to eq(99.to_s)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: worker_killer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.0.
|
|
4
|
+
version: 1.1.0.214159
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samoilenko Yuri
|
|
@@ -176,17 +176,17 @@ signing_key:
|
|
|
176
176
|
specification_version: 4
|
|
177
177
|
summary: Kill any workers by memory and request counts or take custom reaction
|
|
178
178
|
test_files:
|
|
179
|
-
- spec/
|
|
179
|
+
- spec/killer/signal_spec.rb
|
|
180
|
+
- spec/killer/puma_spec.rb
|
|
181
|
+
- spec/killer/delayed_job_spec.rb
|
|
182
|
+
- spec/killer/passenger_spec.rb
|
|
183
|
+
- spec/puma_plugin_spec.rb
|
|
180
184
|
- spec/killer_spec.rb
|
|
185
|
+
- spec/count_limiter_spec.rb
|
|
186
|
+
- spec/worker_killer_spec.rb
|
|
187
|
+
- spec/support/logger.rb
|
|
188
|
+
- spec/middleware_spec.rb
|
|
181
189
|
- spec/spec_helper.rb
|
|
182
|
-
- spec/puma_plugin_spec.rb
|
|
183
190
|
- spec/delayed_job_plugin/oom_limiter_spec.rb
|
|
184
191
|
- spec/delayed_job_plugin/jobs_limiter_spec.rb
|
|
185
|
-
- spec/killer/passenger_spec.rb
|
|
186
|
-
- spec/killer/puma_spec.rb
|
|
187
|
-
- spec/killer/signal_spec.rb
|
|
188
|
-
- spec/killer/delayed_job_spec.rb
|
|
189
192
|
- spec/memory_limiter_spec.rb
|
|
190
|
-
- spec/support/logger.rb
|
|
191
|
-
- spec/worker_killer_spec.rb
|
|
192
|
-
- spec/count_limiter_spec.rb
|