resqued 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/resqued/master.rb +1 -1
- data/lib/resqued/version.rb +1 -1
- data/spec/integration/listener_still_starting_spec.rb +23 -0
- data/spec/integration/master_inherits_child_spec.rb +1 -1
- data/spec/integration/restart_spec.rb +1 -43
- data/spec/spec_helper.rb +1 -0
- data/spec/support/resqued_integration_helpers.rb +50 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a96943adfc574c78c23d78e95aaeae7021c8f0d52ad823db5a39b70e19a3dc03
|
4
|
+
data.tar.gz: 8bbf849c80581ee3faedf6dda7a0a0ff673c56fe402fbdc0f8896689b51b74c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f07ccb1f95a61f283bbb2f12668a92dd8df5a4114d10f4f48b8b0ea825b916c54181e5efa64aded4b11798ad27677cf49b3c039ec6ef83f27cd07a520911ce6
|
7
|
+
data.tar.gz: 66703d00c84c7d010e6454c3bb9522efd499e57520e9e51d2dbfd769d1c2b795d8b1398d19e1283333db8057a804b5ce7d3b985bbe91bad3b2582e5126843692
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
Starting with version 0.6.1, resqued uses semantic versioning to indicate incompatibilities between the master process, listener process, and configuration.
|
2
2
|
|
3
|
+
v0.10.3
|
4
|
+
-------
|
5
|
+
* Fix a timing related crash during reload. (#60)
|
6
|
+
|
3
7
|
v0.10.2
|
4
8
|
-------
|
5
9
|
* Shut down cleanly even if there are other stray child processes of the master. (#59)
|
data/lib/resqued/master.rb
CHANGED
data/lib/resqued/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Listener still starting on SIGHUP" do
|
4
|
+
include ResquedIntegrationHelpers
|
5
|
+
|
6
|
+
it "expect master not to crash" do
|
7
|
+
start_resqued config: <<-CONFIG
|
8
|
+
before_fork do
|
9
|
+
sleep 1
|
10
|
+
end
|
11
|
+
CONFIG
|
12
|
+
expect_running listener: "listener #1"
|
13
|
+
restart_resqued
|
14
|
+
expect_running listener: "listener #2"
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
begin
|
19
|
+
Process.kill(:QUIT, @pid) if @pid
|
20
|
+
rescue Errno::ESRCH
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe "Resqued can restart" do
|
4
|
-
include
|
4
|
+
include ResquedIntegrationHelpers
|
5
5
|
|
6
6
|
it "expect to be able to restart" do
|
7
7
|
start_resqued
|
@@ -18,46 +18,4 @@ describe "Resqued can restart" do
|
|
18
18
|
rescue Errno::ESRCH
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
22
|
-
def expect_running(listener:)
|
23
|
-
processes = list_processes
|
24
|
-
expect(processes).to include(is_resqued_master)
|
25
|
-
listeners = processes.select { |p| p[:ppid] == @pid }.map { |p| p[:args] }
|
26
|
-
expect(listeners).to all(match(/#{listener}/)).and(satisfy { |l| l.size == 1 })
|
27
|
-
end
|
28
|
-
|
29
|
-
def expect_not_running
|
30
|
-
processes = list_processes
|
31
|
-
expect(processes).not_to include(is_resqued_master)
|
32
|
-
end
|
33
|
-
|
34
|
-
def start_resqued
|
35
|
-
# Don't configure any workers. That way, we don't need to have redis running.
|
36
|
-
config_path = File.join(SPEC_TEMPDIR, "config.rb")
|
37
|
-
File.write(config_path, "")
|
38
|
-
|
39
|
-
logfile = File.join(SPEC_TEMPDIR, "resqued.log")
|
40
|
-
File.write(logfile, "") # truncate it
|
41
|
-
|
42
|
-
@pid = spawn resqued_path, "--logfile", logfile, config_path
|
43
|
-
sleep 1.0
|
44
|
-
end
|
45
|
-
|
46
|
-
def restart_resqued
|
47
|
-
Process.kill(:HUP, @pid)
|
48
|
-
sleep 1.0
|
49
|
-
end
|
50
|
-
|
51
|
-
def stop_resqued
|
52
|
-
Process.kill(:TERM, @pid)
|
53
|
-
sleep 1.0
|
54
|
-
end
|
55
|
-
|
56
|
-
def list_processes
|
57
|
-
`ps axo pid,ppid,args`.lines.map { |line| pid, ppid, args = line.strip.split(/\s+/, 3); { pid: pid.to_i, ppid: ppid.to_i, args: args } }
|
58
|
-
end
|
59
|
-
|
60
|
-
def is_resqued_master
|
61
|
-
satisfy { |p| p[:pid] == @pid && p[:args] =~ /resqued-/ }
|
62
|
-
end
|
63
21
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,50 @@
|
|
1
|
+
module ResquedIntegrationHelpers
|
2
|
+
include ResquedPath
|
3
|
+
|
4
|
+
def start_resqued(config: "", debug: false)
|
5
|
+
# Don't configure any workers. That way, we don't need to have redis running.
|
6
|
+
config_path = File.join(SPEC_TEMPDIR, "config.rb")
|
7
|
+
File.write(config_path, config)
|
8
|
+
|
9
|
+
@pid =
|
10
|
+
if debug
|
11
|
+
spawn resqued_path, config_path
|
12
|
+
else
|
13
|
+
logfile = File.join(SPEC_TEMPDIR, "resqued.log")
|
14
|
+
File.write(logfile, "") # truncate it
|
15
|
+
|
16
|
+
spawn resqued_path, "--logfile", logfile, config_path
|
17
|
+
end
|
18
|
+
sleep 1.0
|
19
|
+
end
|
20
|
+
|
21
|
+
def restart_resqued
|
22
|
+
Process.kill(:HUP, @pid)
|
23
|
+
sleep 1.0
|
24
|
+
end
|
25
|
+
|
26
|
+
def expect_running(listener:)
|
27
|
+
processes = list_processes
|
28
|
+
expect(processes).to include(is_resqued_master)
|
29
|
+
listeners = processes.select { |p| p[:ppid] == @pid }.map { |p| p[:args] }
|
30
|
+
expect(listeners).to all(match(/#{listener}/)).and(satisfy { |l| l.size == 1 })
|
31
|
+
end
|
32
|
+
|
33
|
+
def expect_not_running
|
34
|
+
processes = list_processes
|
35
|
+
expect(processes).not_to include(is_resqued_master)
|
36
|
+
end
|
37
|
+
|
38
|
+
def stop_resqued
|
39
|
+
Process.kill(:TERM, @pid)
|
40
|
+
sleep 1.0
|
41
|
+
end
|
42
|
+
|
43
|
+
def list_processes
|
44
|
+
`ps axo pid,ppid,args`.lines.map { |line| pid, ppid, args = line.strip.split(/\s+/, 3); { pid: pid.to_i, ppid: ppid.to_i, args: args } }
|
45
|
+
end
|
46
|
+
|
47
|
+
def is_resqued_master
|
48
|
+
satisfy { |p| p[:pid] == @pid && p[:args] =~ /resqued-/ }
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resqued
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Burke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kgio
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- spec/fixtures/test_case_clean.rb
|
138
138
|
- spec/fixtures/test_case_environment.rb
|
139
139
|
- spec/fixtures/test_case_no_workers.rb
|
140
|
+
- spec/integration/listener_still_starting_spec.rb
|
140
141
|
- spec/integration/master_inherits_child_spec.rb
|
141
142
|
- spec/integration/restart_spec.rb
|
142
143
|
- spec/resqued/backoff_spec.rb
|
@@ -149,6 +150,7 @@ files:
|
|
149
150
|
- spec/spec_helper.rb
|
150
151
|
- spec/support/custom_matchers.rb
|
151
152
|
- spec/support/extra-child-shim
|
153
|
+
- spec/support/resqued_integration_helpers.rb
|
152
154
|
- spec/support/resqued_path.rb
|
153
155
|
homepage: https://github.com/spraints/resqued
|
154
156
|
licenses:
|
@@ -176,7 +178,9 @@ summary: Daemon of resque workers
|
|
176
178
|
test_files:
|
177
179
|
- spec/spec_helper.rb
|
178
180
|
- spec/integration/restart_spec.rb
|
181
|
+
- spec/integration/listener_still_starting_spec.rb
|
179
182
|
- spec/integration/master_inherits_child_spec.rb
|
183
|
+
- spec/support/resqued_integration_helpers.rb
|
180
184
|
- spec/support/custom_matchers.rb
|
181
185
|
- spec/support/resqued_path.rb
|
182
186
|
- spec/support/extra-child-shim
|