resque-heroku-signals 2.5.0 → 2.5.0.1
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/.github/workflows/ci.yml +1 -1
- data/lib/resque-heroku-signals.rb +30 -11
- data/resque-heroku-signals.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62ff5405f78d9e6ad1be2a2807541180adb14ead8924102cc54cefe3d6a0a898
|
4
|
+
data.tar.gz: defed1cc3cd6016402502aab6c53f8e4a610bfc9e6f8c6e17ce3241f57fe7330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703923f42deee729bd04abdb26bbde32a55a6f098007be6b2959c624eb47f9d172d48a3bb9101590df0203c6849fe4a844a5ff274b6594f63cffaaf0fba1f90f
|
7
|
+
data.tar.gz: e3bb87939927ebdb2511f7b44e32f6669d2abe5d39ae9c660e8991fd88e0a4549d87f156e0bed4453f64e93ddace4dd01491609393f49f78dada7224640ce9bc
|
data/.github/workflows/ci.yml
CHANGED
@@ -12,24 +12,43 @@ end
|
|
12
12
|
# https://github.com/resque/resque/blame/v2.0.0/lib/resque/worker.rb#L406
|
13
13
|
# https://github.com/resque/resque/issues/1559#issuecomment-310908574
|
14
14
|
Resque::Worker.class_eval do
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# In this patched implementation, the only change is that the worker sends
|
16
|
+
# SIGINT to the child, the rest is copied verbatim.
|
17
|
+
def new_kill_child
|
18
|
+
if @child
|
19
|
+
unless child_already_exited?
|
20
|
+
if pre_shutdown_timeout && pre_shutdown_timeout > 0.0
|
21
|
+
log_with_severity :debug, "Waiting #{pre_shutdown_timeout.to_f}s for child process to exit"
|
22
|
+
return if wait_for_child_exit(pre_shutdown_timeout)
|
23
|
+
end
|
18
24
|
|
19
|
-
|
20
|
-
|
25
|
+
log_with_severity :debug, "Sending INT signal to child #{@child}"
|
26
|
+
Process.kill("INT", @child)
|
21
27
|
|
22
|
-
|
23
|
-
|
28
|
+
if wait_for_child_exit(term_timeout)
|
29
|
+
return
|
30
|
+
else
|
31
|
+
log_with_severity :debug, "Sending KILL signal to child #{@child}"
|
32
|
+
Process.kill("KILL", @child)
|
24
33
|
end
|
25
|
-
|
26
|
-
|
34
|
+
else
|
35
|
+
log_with_severity :debug, "Child #{@child} already quit."
|
27
36
|
end
|
37
|
+
end
|
38
|
+
rescue SystemCallError
|
39
|
+
log_with_severity :error, "Child #{@child} already quit and reaped."
|
40
|
+
end
|
28
41
|
|
29
|
-
|
42
|
+
def unregister_signal_handlers
|
43
|
+
trap("TERM") do
|
44
|
+
log_with_severity :debug, "Got TERM signal from Heroku."
|
45
|
+
$HEROKU_WILL_TERMINATE_RESQUE = true
|
30
46
|
end
|
31
47
|
|
32
|
-
trap(
|
48
|
+
trap("INT") do
|
49
|
+
log_with_severity :debug, "Got INT signal from the worker."
|
50
|
+
raise Resque::TermException.new("SIGINT")
|
51
|
+
end
|
33
52
|
|
34
53
|
begin
|
35
54
|
trap('QUIT', 'DEFAULT')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-heroku-signals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.0
|
4
|
+
version: 2.5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bianco
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|