resqued 0.8.6 → 0.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4fd16737f4c34d635128439ef78444d44c0109e
4
- data.tar.gz: bcbaa0c45861079f8c4d635ced2d4dc5a79f9b88
3
+ metadata.gz: acc537c28c318ee1628ea4c14911a4716c0d8330
4
+ data.tar.gz: 7b625fcb530e90ca12459f75e7529641dd660758
5
5
  SHA512:
6
- metadata.gz: c333d86b22b3ba87a9202674e15d809874926c8a998d5738a92cae81f18d13eedd43c3701340955c7566937ca78016bd22f3542a5b64850532d92522ebeffc08
7
- data.tar.gz: 418c4dcbeac98eaeb9b02e16cf93ec45e7fc14a150b0f5b69fc0a9f72010e6b6ebae112f377eb6c03ff4cb634582df9df74160d9b2351fb67943ec5ec5e47799
6
+ metadata.gz: 68d8f563141474b5b4e8be2c300763cd34052bfd2da431f2455f01cdbc36abfd9c0cf0d73b87bc599620a6adc0461d246717845a64d4cfe6707d49d2c725cb5b
7
+ data.tar.gz: 23faeaefbffacca556681d465bb9de03d07ff73bd2ab135788e8263998e483db49dbc4d6b75b5b6bfc1d5922634a2427590a34e2134e3d5c28470585ff514d9f
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.9.0
4
+ ------
5
+ * Avoid Errno::E2BIG on SIGHUP when there are lots of workers and lots of queues per worker. (#50) This changes the format of an env var that master passes to listener. Old and new versions won't crash, but they won't be able to communicate about currenly running workers.
6
+
3
7
  v0.8.6
4
8
  ------
5
9
  * Add compatibility for redis 4.0.
@@ -32,7 +32,7 @@ module Resqued
32
32
  socket_fd = @socket.to_i
33
33
  ENV['RESQUED_SOCKET'] = socket_fd.to_s
34
34
  ENV['RESQUED_CONFIG_PATH'] = @config_paths.join(':')
35
- ENV['RESQUED_STATE'] = (@old_workers.map { |r| "#{r[:pid]}|#{r[:queue]}" }.join('||'))
35
+ ENV['RESQUED_STATE'] = (@old_workers.map { |r| "#{r[:pid]}|#{r[:queue_key]}" }.join('||'))
36
36
  ENV['RESQUED_LISTENER_ID'] = @listener_id.to_s
37
37
  ENV['RESQUED_MASTER_VERSION'] = Resqued::VERSION
38
38
  log "exec: #{Resqued::START_CTX['$0']} listener"
@@ -54,7 +54,7 @@ module Resqued
54
54
  options[:config_paths] = path.split(':')
55
55
  end
56
56
  if state = ENV['RESQUED_STATE']
57
- options[:old_workers] = state.split('||').map { |s| Hash[[:pid,:queue].zip(s.split('|'))] }
57
+ options[:old_workers] = state.split('||').map { |s| Hash[[:pid,:queue_key].zip(s.split('|'))] }
58
58
  end
59
59
  if listener_id = ENV['RESQUED_LISTENER_ID']
60
60
  options[:listener_id] = listener_id
@@ -223,7 +223,7 @@ module Resqued
223
223
  def init_workers(config)
224
224
  @workers = config.build_workers
225
225
  @old_workers.each do |running_worker|
226
- if blocked_worker = @workers.detect { |worker| worker.idle? && worker.queue_key == running_worker[:queue] }
226
+ if blocked_worker = @workers.detect { |worker| worker.idle? && worker.queue_key == running_worker[:queue_key] }
227
227
  blocked_worker.wait_for(running_worker[:pid].to_i)
228
228
  end
229
229
  end
@@ -57,7 +57,7 @@ module Resqued
57
57
 
58
58
  # Public: Get the list of workers running from this listener.
59
59
  def running_workers
60
- worker_pids.map { |pid, queue| { :pid => pid, :queue => queue } }
60
+ worker_pids.map { |pid, queue_key| { :pid => pid, :queue_key => queue_key } }
61
61
  end
62
62
 
63
63
  # Private: Map worker pids to queue names
@@ -1,3 +1,3 @@
1
1
  module Resqued
2
- VERSION = '0.8.6'
2
+ VERSION = '0.9.0'
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'resque'
2
+ require 'digest'
2
3
 
3
4
  require 'resqued/backoff'
4
5
  require 'resqued/logging'
@@ -43,7 +44,7 @@ module Resqued
43
44
 
44
45
  # Public: A string that compares if this worker is equivalent to a worker in another Resqued::Listener.
45
46
  def queue_key
46
- queues.sort.join(';')
47
+ Digest::SHA256.hexdigest(queues.sort.join(';'))
47
48
  end
48
49
 
49
50
  # Public: Claim this worker for another listener's worker.
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.8.6
4
+ version: 0.9.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: 2019-04-01 00:00:00.000000000 Z
11
+ date: 2019-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kgio
@@ -156,22 +156,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.5.2.3
159
+ rubygems_version: 2.5.2.1
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Daemon of resque workers
163
163
  test_files:
164
+ - spec/resqued/sleepy_spec.rb
165
+ - spec/resqued/backoff_spec.rb
166
+ - spec/resqued/config/worker_spec.rb
167
+ - spec/resqued/config/fork_event_spec.rb
168
+ - spec/resqued/start_ctx_spec.rb
169
+ - spec/resqued/config_spec.rb
170
+ - spec/resqued/test_case_spec.rb
164
171
  - spec/spec_helper.rb
165
- - spec/support/custom_matchers.rb
166
- - spec/fixtures/test_case_clean.rb
167
172
  - spec/fixtures/test_case_before_fork_raises.rb
168
173
  - spec/fixtures/test_case_environment.rb
169
174
  - spec/fixtures/test_case_no_workers.rb
170
175
  - spec/fixtures/test_case_after_fork_raises.rb
171
- - spec/resqued/config_spec.rb
172
- - spec/resqued/config/fork_event_spec.rb
173
- - spec/resqued/config/worker_spec.rb
174
- - spec/resqued/sleepy_spec.rb
175
- - spec/resqued/test_case_spec.rb
176
- - spec/resqued/start_ctx_spec.rb
177
- - spec/resqued/backoff_spec.rb
176
+ - spec/fixtures/test_case_clean.rb
177
+ - spec/support/custom_matchers.rb