resqued 0.10.3 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a96943adfc574c78c23d78e95aaeae7021c8f0d52ad823db5a39b70e19a3dc03
4
- data.tar.gz: 8bbf849c80581ee3faedf6dda7a0a0ff673c56fe402fbdc0f8896689b51b74c0
3
+ metadata.gz: 606d7e3fb51d8595ce4a8e4fe7bdb28fc3aa73323652cbb98f9e0db19e982960
4
+ data.tar.gz: 87d0126e0b4f6e804a63d680d6946aa83621d19ddfa22c9427772d84eb9208df
5
5
  SHA512:
6
- metadata.gz: 2f07ccb1f95a61f283bbb2f12668a92dd8df5a4114d10f4f48b8b0ea825b916c54181e5efa64aded4b11798ad27677cf49b3c039ec6ef83f27cd07a520911ce6
7
- data.tar.gz: 66703d00c84c7d010e6454c3bb9522efd499e57520e9e51d2dbfd769d1c2b795d8b1398d19e1283333db8057a804b5ce7d3b985bbe91bad3b2582e5126843692
6
+ metadata.gz: abcd739a5f7d36a1e980b055e90e36cd63d0303264126f35a27ef260717022fda2ddd23630b13a954d93cb2f038067ae9d2579347b5ca1a48a19ab18528d5a2e
7
+ data.tar.gz: 82b66d4c943da3c73e5ae0459197fad97931770eeb3d6acd77b556f69d285e2c8666823b2f9fd563d25337974012d81b5e8d4f2f64b5f39d835e7c8dbada409c
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.11.0
4
+ -------
5
+ * Ignore SIGHUP in Listener and Worker processes. (#61)
6
+
3
7
  v0.10.3
4
8
  -------
5
9
  * Fix a timing related crash during reload. (#60)
@@ -34,6 +34,8 @@ The Listener process forwards `SIGCONT` to all of its workers.
34
34
 
35
35
  The Listener process handles `SIGINT`, `SIGTERM`, and `SIGQUIT`. When it receives one of these signals, it goes into shutdown mode. It sends the received signal to all of its workers. When all workers have exited, the Listener process exits.
36
36
 
37
+ The Listener process handles `SIGHUP` and does nothing. This makes it easier to reload resqued in a docker container, since many container platforms will send a requested signal to all processes in the container.
38
+
37
39
  ## Worker
38
40
 
39
41
  The Worker process uses resque's signal handling. Resque 1.23.0 handles the following signals:
@@ -44,3 +46,5 @@ The Worker process uses resque's signal handling. Resque 1.23.0 handles the foll
44
46
  * `USR1`: Kill the forked child immediately, continue processing jobs.
45
47
  * `USR2`: Don't process any new jobs
46
48
  * `CONT`: Start processing jobs again after a USR2
49
+
50
+ Resqued leaves a handler for `HUP` in place that does nothing. This makes it easier to reload resqued in a docker container, since many container platforms will send a requested signal to all processes in the container.
@@ -63,12 +63,13 @@ module Resqued
63
63
  end
64
64
 
65
65
  SIGNALS = [:CONT, :QUIT, :INT, :TERM].freeze
66
- ALL_SIGNALS = SIGNALS + [:CHLD]
66
+ ALL_SIGNALS = SIGNALS + [:CHLD, :HUP]
67
67
 
68
68
  SIGNAL_QUEUE = [] # rubocop: disable Style/MutableConstant
69
69
 
70
70
  # Public: Run the main loop.
71
71
  def run
72
+ trap(:HUP) {} # ignore this, in case it trickles in from the master.
72
73
  trap(:CHLD) { awake }
73
74
  SIGNALS.each { |signal| trap(signal) { SIGNAL_QUEUE << signal; awake } }
74
75
  @socket.close_on_exec = true
@@ -1,3 +1,3 @@
1
1
  module Resqued
2
- VERSION = '0.10.3'
2
+ VERSION = "0.11.0".freeze
3
3
  end
@@ -91,7 +91,11 @@ module Resqued
91
91
  else
92
92
  # In case we get a signal before resque is ready for it.
93
93
  Resqued::Listener::ALL_SIGNALS.each { |signal| trap(signal, "DEFAULT") }
94
- trap(:QUIT) { exit! 0 } # If we get a QUIT during boot, just spin back down.
94
+ # Continue ignoring SIGHUP, though.
95
+ trap(:HUP) {}
96
+ # If we get a QUIT during boot, just spin back down.
97
+ trap(:QUIT) { exit! 0 }
98
+
95
99
  $0 = "STARTING RESQUE FOR #{queues.join(',')}"
96
100
  resque_worker = @worker_factory.call(queues)
97
101
  @config.after_fork(resque_worker)
@@ -11,6 +11,7 @@ describe "Listener still starting on SIGHUP" do
11
11
  CONFIG
12
12
  expect_running listener: "listener #1"
13
13
  restart_resqued
14
+ sleep 2
14
15
  expect_running listener: "listener #2"
15
16
  end
16
17
 
@@ -125,17 +125,17 @@ describe Resqued::Config::Worker do
125
125
 
126
126
  context "pool, with shuffled queues" do
127
127
  let(:config) { <<-END_CONFIG }
128
- worker_pool 20, :shuffle_queues => true
129
- queue 'a', :count => 10
130
- queue 'b', :count => 15
128
+ worker_pool 200, :shuffle_queues => true
129
+ queue 'a', :count => 100
130
+ queue 'b', :count => 150
131
131
  END_CONFIG
132
- it { expect(result.size).to eq(20) }
133
- it { (0..9).each { |i| expect(result[i][:queues].sort).to eq(["a", "b"]) } }
134
- it { (10..14).each { |i| expect(result[i][:queues]).to eq(["b"]) } }
135
- it { (15..19).each { |i| expect(result[i][:queues]).to eq(["*"]) } }
132
+ it { expect(result.size).to eq(200) }
133
+ it { (0..99).each { |i| expect(result[i][:queues].sort).to eq(["a", "b"]) } }
134
+ it { (100..149).each { |i| expect(result[i][:queues]).to eq(["b"]) } }
135
+ it { (150..199).each { |i| expect(result[i][:queues]).to eq(["*"]) } }
136
136
  it { result.each { |x| expect(x).not_to have_key(:shuffle_queues) } }
137
137
  it do
138
- shuffled_queues = result.take(10).map { |x| x[:queues] }
138
+ shuffled_queues = result.take(100).map { |x| x[:queues] }
139
139
  expect(shuffled_queues.sort.uniq).to eq([["a", "b"], ["b", "a"]]) # Some of the queues should be shuffled
140
140
  end
141
141
  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.3
4
+ version: 0.11.0
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-19 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kgio