worker_killer 1.1.0.214146 → 1.1.0.223443
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/worker_killer/killer/puma.rb +4 -6
- data/spec/killer/puma_spec.rb +2 -2
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fba3518e6f518f19b01b87115d33fe0db060fad10c4982eeb66fbdf06700045
|
4
|
+
data.tar.gz: e2bc9e0d6db5185aeecf1c787bc7655065d701692ef1660cbdc14982b1d90001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bb02b8cb52fe1a212bbbcf2a67f413c8cf22ee3808d1b1712e35bf8bc57ff2f4f6cab27006210c2bcc7ee23bd94055f0e7cc454da0f371138c3f5f4b6ced7d
|
7
|
+
data.tar.gz: b6a80f43dcfcfc15731f594c1aaa93a87305c83ad8a5f8bc8e3cd5bfa623090adb367fb8251e458836e409664310ef9c648e0e97f67e6647e0686e96a7383d88
|
@@ -13,13 +13,11 @@ module ::WorkerKiller
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def do_kill(sig, pid, alive_sec, **_params)
|
16
|
-
if
|
17
|
-
|
18
|
-
|
19
|
-
return
|
20
|
-
end
|
16
|
+
return if @already_sended == sig
|
17
|
+
|
18
|
+
logger.warn "#{self} send #{worker_num} to Puma Plugin (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts}) triggered by #{sig}"
|
21
19
|
|
22
|
-
|
20
|
+
@already_sended = sig
|
23
21
|
|
24
22
|
Socket.unix(ipc_path) do |sock|
|
25
23
|
sock.puts Integer(worker_num).to_s
|
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,14 +1,14 @@
|
|
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.223443
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02
|
11
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: get_process_mem
|
@@ -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
|