sidekiq 3.5.1 → 3.5.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: 92ef60dcba913bb8fdbb05e1c0a8dec0071146f3
4
- data.tar.gz: 7c607121e01d8df3e83c09ab77876fde573cb1af
3
+ metadata.gz: d32882da4b01eefa0b25a91791c4580293642b24
4
+ data.tar.gz: ced4b35fcc8a0804a482eb64e8b0af88bf6b5b50
5
5
  SHA512:
6
- metadata.gz: 980ecb9625038a8b0211d73ab6ac8176f6c7bf55c03da3c7e810016169ba76449ad43e602be337e1cc4d094aa2a9229ff565d37dd8bb6f094de62a34f61bc8e5
7
- data.tar.gz: 420995af74088296a8ebf722f438be5b57f1a459acb0678956223d85341b8a4352a268da65b9ef4bcab3c275b5b66f7db3113fe75d6f52f6c1d2188a264d7867
6
+ metadata.gz: 00caf9ea622f2c1e35706a07c77e02a420b381f482f158de1a1ea4c4b9a3f3a478df5df654bf9982b4ce434088b3401b596274cfd15985299ca6d54931a056ea
7
+ data.tar.gz: 00cf54c70ec9d4b2ced99dc06ecb7dc39cf57ed938ad16f6cdf2198ea96609f2d83c95841c72a3140e1203a6abdba68476e92d0a801cbb58fe3f1939842e3a20
data/Changes.md CHANGED
@@ -1,7 +1,27 @@
1
+ # Sidekiq Changes
2
+
3
+ 3.5.2
4
+ -----------
5
+
6
+ - **Sidekiq 3 is now in maintenance mode**, only major bugs will be fixed.
7
+ - The exception triggering a retry is now passed into `sidekiq_retry_in`,
8
+ allowing you to retry more frequently for certain types of errors.
9
+ [#2619, kreynolds]
10
+ ```ruby
11
+ sidekiq_retry_in do |count, ex|
12
+ case ex
13
+ when RuntimeError
14
+ 5 * count
15
+ else
16
+ 10 * count
17
+ end
18
+ end
19
+ ```
20
+
1
21
  3.5.1
2
22
  -----------
3
23
 
4
- - **FIX MEMORY LEAK** Under rare conditions, threads may leak [#2598]
24
+ - **FIX MEMORY LEAK** Under rare conditions, threads may leak [#2598, gazay]
5
25
  - Add Ukranian locale [#2561, elrakita]
6
26
  - Disconnect and retry Redis operations if we see a READONLY error [#2550]
7
27
  - Add server middleware testing harness; see [wiki](https://github.com/mperham/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
@@ -3,6 +3,17 @@ Sidekiq Enterprise Changelog
3
3
 
4
4
  Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
5
5
 
6
+ 0.7.5
7
+ ----------
8
+
9
+ - Fix dynamic creation of concurrent limiters [#2617]
10
+
11
+ 0.7.4
12
+ ----------
13
+ - Add additional check to prevent duplicate periodic job creation
14
+ - Allow user-specified TTLs for rate limiters [#2607]
15
+ - Paginate rate limiter index page [#2606]
16
+
6
17
  0.7.3
7
18
  ----------
8
19
 
@@ -11,7 +22,6 @@ Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how t
11
22
  rate limit errors.
12
23
  - Fix scalability issue with Limiter index page.
13
24
 
14
-
15
25
  0.7.2
16
26
  ----------
17
27
 
@@ -23,7 +33,6 @@ Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how t
23
33
  - Fix issue where unique scheduled jobs can't be enqueued upon schedule
24
34
  due to the existing unique lock. [#2499]
25
35
 
26
-
27
36
  0.7.0
28
37
  ----------
29
38
 
@@ -3,6 +3,12 @@ Sidekiq Pro Changelog
3
3
 
4
4
  Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
5
5
 
6
+ 2.1.1
7
+ -----------
8
+
9
+ - Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
10
+
11
+
6
12
  2.1.0
7
13
  -----------
8
14
 
@@ -346,7 +346,11 @@ module Sidekiq
346
346
  die 1
347
347
  end
348
348
  @parser.parse!(argv)
349
- opts[:config_file] ||= 'config/sidekiq.yml' if File.exist?('config/sidekiq.yml')
349
+
350
+ %w[config/sidekiq.yml config/sidekiq.yml.erb].each do |filename|
351
+ opts[:config_file] ||= filename if File.exist?(filename)
352
+ end
353
+
350
354
  opts
351
355
  end
352
356
 
@@ -121,7 +121,7 @@ module Sidekiq
121
121
  end
122
122
 
123
123
  if count < max_retry_attempts
124
- delay = delay_for(worker, count)
124
+ delay = delay_for(worker, count, exception)
125
125
  logger.debug { "Failure! Retry #{count} in #{delay} seconds" }
126
126
  retry_at = Time.now.to_f + delay
127
127
  payload = Sidekiq.dump_json(msg)
@@ -170,8 +170,8 @@ module Sidekiq
170
170
  end
171
171
  end
172
172
 
173
- def delay_for(worker, count)
174
- worker.sidekiq_retry_in_block? && retry_in(worker, count) || seconds_to_delay(count)
173
+ def delay_for(worker, count, exception)
174
+ worker.sidekiq_retry_in_block? && retry_in(worker, count, exception) || seconds_to_delay(count)
175
175
  end
176
176
 
177
177
  # delayed_job uses the same basic formula
@@ -179,9 +179,9 @@ module Sidekiq
179
179
  (count ** 4) + 15 + (rand(30)*(count+1))
180
180
  end
181
181
 
182
- def retry_in(worker, count)
182
+ def retry_in(worker, count, exception)
183
183
  begin
184
- worker.sidekiq_retry_in_block.call(count).to_i
184
+ worker.sidekiq_retry_in_block.call(count, exception).to_i
185
185
  rescue Exception => e
186
186
  handle_exception(e, { context: "Failure scheduling retry using the defined `sidekiq_retry_in` in #{worker.class.name}, falling back to default" })
187
187
  nil
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "3.5.1"
2
+ VERSION = "3.5.2"
3
3
  end
@@ -38,6 +38,18 @@ module Sidekiq
38
38
 
39
39
  module ClassMethods
40
40
 
41
+ def delay(*args)
42
+ raise ArgumentError, "Do not call .delay on a Sidekiq::Worker class, call .perform_async"
43
+ end
44
+
45
+ def delay_for(*args)
46
+ raise ArgumentError, "Do not call .delay_for on a Sidekiq::Worker class, call .perform_in"
47
+ end
48
+
49
+ def delay_until(*args)
50
+ raise ArgumentError, "Do not call .delay_until on a Sidekiq::Worker class, call .perform_at"
51
+ end
52
+
41
53
  def perform_async(*args)
42
54
  client_push('class' => self, 'args' => args)
43
55
  end
@@ -202,10 +202,10 @@ class TestApi < Sidekiq::Test
202
202
  end
203
203
 
204
204
  it 'unwraps delayed jobs' do
205
- ApiWorker.delay.foo(1,2,3)
205
+ Sidekiq::Queue.delay.foo(1,2,3)
206
206
  q = Sidekiq::Queue.new
207
207
  x = q.first
208
- assert_equal "TestApi::ApiWorker.foo", x.display_class
208
+ assert_equal "Sidekiq::Queue.foo", x.display_class
209
209
  assert_equal [1,2,3], x.display_args
210
210
  end
211
211
 
@@ -229,7 +229,7 @@ class TestRetry < Sidekiq::Test
229
229
  File.unlink @tmp_log_path if File.exist?(@tmp_log_path)
230
230
  end
231
231
 
232
- class CustomWorker
232
+ class CustomWorkerWithoutException
233
233
  include Sidekiq::Worker
234
234
 
235
235
  sidekiq_retry_in do |count|
@@ -237,6 +237,19 @@ class TestRetry < Sidekiq::Test
237
237
  end
238
238
  end
239
239
 
240
+ class CustomWorkerWithException
241
+ include Sidekiq::Worker
242
+
243
+ sidekiq_retry_in do |count, exception|
244
+ case exception
245
+ when ArgumentError
246
+ count * 4
247
+ else
248
+ count * 2
249
+ end
250
+ end
251
+ end
252
+
240
253
  class ErrorWorker
241
254
  include Sidekiq::Worker
242
255
 
@@ -246,15 +259,23 @@ class TestRetry < Sidekiq::Test
246
259
  end
247
260
 
248
261
  it "retries with a default delay" do
249
- refute_equal 4, handler.__send__(:delay_for, worker, 2)
262
+ refute_equal 4, handler.__send__(:delay_for, worker, 2, StandardError.new)
263
+ end
264
+
265
+ it "retries with a custom delay and exception 1" do
266
+ assert_equal 8, handler.__send__(:delay_for, CustomWorkerWithException, 2, ArgumentError.new)
267
+ end
268
+
269
+ it "retries with a custom delay and exception 2" do
270
+ assert_equal 4, handler.__send__(:delay_for, CustomWorkerWithException, 2, StandardError.new)
250
271
  end
251
272
 
252
- it "retries with a custom delay" do
253
- assert_equal 4, handler.__send__(:delay_for, CustomWorker, 2)
273
+ it "retries with a custom delay without exception" do
274
+ assert_equal 4, handler.__send__(:delay_for, CustomWorkerWithoutException, 2, StandardError.new)
254
275
  end
255
276
 
256
277
  it "falls back to the default retry on exception" do
257
- refute_equal 4, handler.__send__(:delay_for, ErrorWorker, 2)
278
+ refute_equal 4, handler.__send__(:delay_for, ErrorWorker, 2, StandardError.new)
258
279
  assert_match(/Failure scheduling retry using the defined `sidekiq_retry_in`/,
259
280
  File.read(@tmp_log_path), 'Log entry missing for sidekiq_retry_in')
260
281
  end
@@ -58,9 +58,14 @@ function updatePage(url) {
58
58
  url: url,
59
59
  dataType: 'html'
60
60
  }).done(function (data) {
61
- var $page = $(data).filter('#page')
61
+ $data = $(data)
62
+
63
+ var $page = $data.filter('#page')
62
64
  $('#page').replaceWith($page)
63
65
 
66
+ var $header_status = $data.find('.status')
67
+ $('.status').replaceWith($header_status)
68
+
64
69
  $("time").timeago()
65
70
  })
66
71
  }, parseInt(localStorage.timeInterval) || 2000);
@@ -181,6 +181,10 @@ form .btn {
181
181
  margin-right: 5px;
182
182
  }
183
183
 
184
+ form .btn-group .btn {
185
+ margin-right: 1px;
186
+ }
187
+
184
188
  td form {
185
189
  margin-bottom: 0;
186
190
  }
@@ -12,7 +12,6 @@
12
12
  </form>
13
13
  </div>
14
14
  </div>
15
- </div>
16
15
 
17
16
  <div class="table_container">
18
17
  <table class="processes table table-hover table-bordered table-striped table-white">
@@ -5,6 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1.0" />
6
6
  <link href="<%= root_path %>stylesheets/bootstrap.css" media="screen" rel="stylesheet" type="text/css" />
7
7
  <link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
8
+ <link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
8
9
  <script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
9
10
  <script type="text/javascript" src="<%= root_path %>javascripts/locales/jquery.timeago.<%= locale %>.js"></script>
10
11
  <meta name="google" content="notranslate" />
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: 3.5.1
4
+ version: 3.5.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: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -263,6 +263,7 @@ files:
263
263
  - test/test_web_helpers.rb
264
264
  - web/assets/images/bootstrap/glyphicons-halflings-white.png
265
265
  - web/assets/images/bootstrap/glyphicons-halflings.png
266
+ - web/assets/images/favicon.ico
266
267
  - web/assets/images/logo.png
267
268
  - web/assets/images/status-sd8051fd480.png
268
269
  - web/assets/images/status/active.png
@@ -377,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
377
378
  version: '0'
378
379
  requirements: []
379
380
  rubyforge_project:
380
- rubygems_version: 2.4.5.1
381
+ rubygems_version: 2.4.5
381
382
  signing_key:
382
383
  specification_version: 4
383
384
  summary: Simple, efficient background processing for Ruby