sidekiq 5.2.1 → 5.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b5307056552014ab284241c16aa83a8d334d31b
4
- data.tar.gz: acc9588810366d8c6dbb03d3c5cbe140a169f501
3
+ metadata.gz: 985b2f1c0778b1e4d2587eb2f182fc58723277c7
4
+ data.tar.gz: 2d20a6e15e248bea802b1ca9438c9507a1f94ab4
5
5
  SHA512:
6
- metadata.gz: 8b051912f610e763585e847a991cee6e684d4b27111f91cfe395a1e02539424e931f5ba16141e30a06c3dcf9de3c54db578be47a9fcd629222b81d8295f7c12a
7
- data.tar.gz: 836cc95385406201ad9e26363698d838381ef993e75034bfc030c4ef0d2821c80e3a4612c5a7ec8bfca1d7acdadd02bcf29f5b979d56ece6752686f6293216ef
6
+ metadata.gz: 4e4be1e23c16eb53d43424a0a07e6b69ab2001ffbbaf28c7c09db1dac89d9f1e9ac3513c70ac5abd398efb12c8a712da20f563df5fd055c6855eb5d2d7abea05
7
+ data.tar.gz: 8947fc9287e9a1336ba57b6ef380e5f76d7ea7382fff3930acd914c6c08fed9c08940780c1537bbedf349ed29257b9c249f8356eed095d8537a4195e7426b676
data/Changes.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/mperham/sidekiq/blob/master/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md)
4
4
 
5
+ 5.2.2
6
+ ---------
7
+
8
+ - Raise error for duplicate queue names in config to avoid unexpected fetch algorithm change [#3911]
9
+ - Fix concurrency bug on JRuby [#3958, mattbooks]
10
+ - Add "Kill All" button to the retries page [#3938]
11
+
5
12
  5.2.1
6
13
  -----------
7
14
 
data/Pro-Changes.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
6
6
 
7
+ 4.0.4
8
+ ---------
9
+
10
+ - Update Sidekiq::Client patches to work with new Module#prepend
11
+ mechanism in Sidekiq 5.2.0. [#3930]
12
+
7
13
  4.0.3
8
14
  ---------
9
15
 
@@ -26,6 +32,7 @@ batch.on(:death, ...)
26
32
  ---------
27
33
 
28
34
  - Fix incompatibility with the statsd-ruby gem [#3740]
35
+ - Add tags to Statsd metrics when using Datadog [#3744]
29
36
 
30
37
  4.0.0
31
38
  ---------
data/lib/sidekiq/api.rb CHANGED
@@ -670,6 +670,12 @@ module Sidekiq
670
670
  each(&:retry)
671
671
  end
672
672
  end
673
+
674
+ def kill_all
675
+ while size > 0
676
+ each(&:kill)
677
+ end
678
+ end
673
679
  end
674
680
 
675
681
  ##
data/lib/sidekiq/cli.rb CHANGED
@@ -436,9 +436,9 @@ module Sidekiq
436
436
  end
437
437
 
438
438
  def parse_queue(opts, q, weight=nil)
439
- [weight.to_i, 1].max.times do
440
- (opts[:queues] ||= []) << q
441
- end
439
+ opts[:queues] ||= []
440
+ raise ArgumentError, "queues: #{q} cannot be defined twice" if opts[:queues].include?(q)
441
+ [weight.to_i, 1].max.times { opts[:queues] << q }
442
442
  opts[:strict] = false if weight.to_i > 0
443
443
  end
444
444
  end
@@ -203,15 +203,41 @@ module Sidekiq
203
203
  end
204
204
  end
205
205
 
206
+ # jruby's Hash implementation is not threadsafe, so we wrap it in a mutex here
207
+ class SharedWorkerState
208
+ def initialize
209
+ @worker_state = {}
210
+ @lock = Mutex.new
211
+ end
212
+
213
+ def set(tid, hash)
214
+ @lock.synchronize { @worker_state[tid] = hash }
215
+ end
216
+
217
+ def delete(tid)
218
+ @lock.synchronize { @worker_state.delete(tid) }
219
+ end
220
+
221
+ def dup
222
+ @lock.synchronize { @worker_state.dup }
223
+ end
224
+
225
+ def size
226
+ @lock.synchronize { @worker_state.size }
227
+ end
228
+
229
+ def clear
230
+ @lock.synchronize { @worker_state.clear }
231
+ end
232
+ end
233
+
206
234
  PROCESSED = Counter.new
207
235
  FAILURE = Counter.new
208
- # This is mutable global state but because each thread is storing
209
- # its own unique key/value, there's no thread-safety issue AFAIK.
210
- WORKER_STATE = {}
236
+ WORKER_STATE = SharedWorkerState.new
211
237
 
212
238
  def stats(job_hash, queue)
213
239
  tid = Sidekiq::Logging.tid
214
- WORKER_STATE[tid] = {:queue => queue, :payload => job_hash, :run_at => Time.now.to_i }
240
+ WORKER_STATE.set(tid, {:queue => queue, :payload => job_hash, :run_at => Time.now.to_i })
215
241
 
216
242
  begin
217
243
  yield
@@ -78,7 +78,7 @@ module Sidekiq
78
78
  opts.delete(:network_timeout)
79
79
  end
80
80
 
81
- opts[:driver] ||= 'ruby'
81
+ opts[:driver] ||= Redis::Connection.drivers.last || 'ruby'
82
82
 
83
83
  # Issue #3303, redis-rb will silently retry an operation.
84
84
  # This can lead to duplicate jobs if Sidekiq::Client's LPUSH
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sidekiq
3
- VERSION = "5.2.1"
3
+ VERSION = "5.2.2"
4
4
  end
@@ -196,6 +196,12 @@ module Sidekiq
196
196
  redirect "#{root_path}retries"
197
197
  end
198
198
 
199
+ post "/retries/all/kill" do
200
+ Sidekiq::RetrySet.new.kill_all
201
+
202
+ redirect "#{root_path}retries"
203
+ end
204
+
199
205
  post "/retries/:key" do
200
206
  job = Sidekiq::RetrySet.new.fetch(*parse_params(route_params[:key])).first
201
207
 
@@ -121,7 +121,7 @@ module Sidekiq
121
121
  end
122
122
 
123
123
  def t(msg, options={})
124
- string = get_locale[msg] || msg
124
+ string = get_locale[msg] || strings('en')[msg] || msg
125
125
  if options.empty?
126
126
  string
127
127
  else
data/web/locales/ar.yml CHANGED
@@ -40,6 +40,7 @@ ar:
40
40
  AreYouSure: هل انت متأكد؟
41
41
  DeleteAll: حذف الكل
42
42
  RetryAll: إعادة المحاولة للكل
43
+ KillAll: إبطال الكل
43
44
  NoRetriesFound: لاتوجد أي إعادة محاولة
44
45
  Error: خطأ
45
46
  ErrorClass: نوع الخطأ
data/web/locales/en.yml CHANGED
@@ -39,6 +39,7 @@ en: # <---- change this to your locale code
39
39
  AreYouSure: Are you sure?
40
40
  DeleteAll: Delete All
41
41
  RetryAll: Retry All
42
+ KillAll: Kill All
42
43
  NoRetriesFound: No retries were found
43
44
  Error: Error
44
45
  ErrorClass: Error Class
data/web/views/queue.erb CHANGED
@@ -5,6 +5,7 @@
5
5
  <% if @queue.paused? %>
6
6
  <span class="label label-danger"><%= t('Paused') %></span>
7
7
  <% end %>
8
+ <span class="badge badge-secondary"><%= number_with_delimiter(@total_size) %></span>
8
9
  </h3>
9
10
  </div>
10
11
  <div class="col-sm-4 pull-right flip">
@@ -69,6 +69,10 @@
69
69
  <%= csrf_tag %>
70
70
  <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
71
71
  </form>
72
+ <form action="<%= root_path %>retries/all/kill" method="post">
73
+ <%= csrf_tag %>
74
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
75
+ </form>
72
76
  <% end %>
73
77
 
74
78
  <% else %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis