sidekiq 4.2.7 → 4.2.8

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: 4a0c3d337d5c12118df6a841022364a29a0d0f32
4
- data.tar.gz: b28df88c08bed2192a2a6a529928120887ca595a
3
+ metadata.gz: fe925959389b100c1bddc94d0d2851708ca1c31a
4
+ data.tar.gz: 2759f348ba3fe6881a8d5921347e78cdaaba93b8
5
5
  SHA512:
6
- metadata.gz: f397a4ca48db4a830b4b7c41a95b2df0b594bf41ad0777f1c79acb821649ff7c87d9790810730aa353ba40e1af5d050f229e23bac1cc2055681d51b3bf11efe6
7
- data.tar.gz: 5b83dea7315ee15bc8d0020873774f6896c41f1ec821292bedaf1e4595a30a966f7ebd91504a7933e57efbf900a5e1b0bc2fb2183f49333d77990535b37119ec
6
+ metadata.gz: 81df636c013d70dc7f86578d1b473ee9145068311a9a1b8952c3d4166763a68a765b36598a11076b70b21508c92f2bb3061aa64727262fd80e64892e1bfd3176
7
+ data.tar.gz: adc95ecacca483bf1e60ffd2732f600d9e401063b8d30cd7f47659ac831abd9c7d563ead4da9c712ed3cfc49890ef92ebe3d0da6610839b84f685c37d224e1ad
@@ -9,4 +9,5 @@ before_install:
9
9
  rvm:
10
10
  - 2.2.4
11
11
  - 2.3.0
12
- - jruby-head
12
+ - 2.4.0
13
+ - jruby-9.1.6.0
data/Changes.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Sidekiq Changes
2
2
 
3
+ 4.2.8
4
+ -----------
5
+
6
+ - Fix rare edge case with Redis driver that can create duplicate jobs [#3303]
7
+ - Fix Rails 5 loading issue [#3275]
8
+ - Restore missing tooltips to timestamps in Web UI [#3310]
9
+ - Work on **Sidekiq 5.0** is now active! [#3301]
10
+
3
11
  4.2.7
4
12
  -----------
5
13
 
@@ -3,11 +3,18 @@ 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
- HEAD
6
+ 1.5.1
7
+ -------------
8
+
9
+ - Fix issue with census startup when not using Bundler configuration for
10
+ source credentials.
11
+
12
+ 1.5.0
7
13
  -------------
8
14
 
9
15
  - Add new web authorization API [#3251]
10
16
  - Update all sidekiqswarm env vars to use SIDEKIQ\_ prefix [#3218]
17
+ - Add census reporting, the leader will ping contribsys nightly with aggregate usage metrics
11
18
 
12
19
  1.4.0
13
20
  -------------
data/Gemfile CHANGED
@@ -1,11 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'rails', '5.0.0'
4
+ gem 'rails', '>= 5.0.1'
5
5
  gem "hiredis"
6
6
  gem 'simplecov'
7
7
  gem 'minitest'
8
- gem 'minitest-utils'
8
+ #gem 'minitest-utils'
9
9
  gem 'toxiproxy'
10
10
 
11
11
  platforms :rbx do
@@ -3,10 +3,19 @@ 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
- HEAD
6
+ 3.4.1
7
7
  ---------
8
8
 
9
- - Don't display "Delete/Retry All" buttons when filtering in Web UI, #3243
9
+ - Allow super\_fetch's orphan job check to happen as often as every hour [#3273]
10
+ - Officially deprecate reliable\_fetch algorithm, I now recommend you use `super_fetch` instead:
11
+ ```ruby
12
+ Sidekiq.configure_server do |config|
13
+ config.super_fetch!
14
+ end
15
+ ```
16
+ Also note that Sidekiq's `-i/--index` option is no longer used/relevant with super\_fetch.
17
+ - Don't display "Delete/Retry All" buttons when filtering in Web UI [#3243]
18
+ - Reimplement Sidekiq::JobSet#find\_job with ZSCAN [#3197]
10
19
 
11
20
  3.4.0
12
21
  ---------
@@ -1,4 +1,4 @@
1
- require_relative 'test_helper'
1
+ require 'test_helper'
2
2
  <% module_namespacing do -%>
3
3
  class <%= class_name %>WorkerTest < <% if defined? Minitest::Test %>Minitest::Test<% else %>MiniTest::Unit::TestCase<% end %>
4
4
  def test_example
@@ -142,7 +142,7 @@ module Sidekiq
142
142
  end
143
143
  when 'TTIN'
144
144
  Thread.list.each do |thread|
145
- Sidekiq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
145
+ Sidekiq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread['sidekiq_label']}"
146
146
  if thread.backtrace
147
147
  Sidekiq.logger.warn thread.backtrace.join("\n")
148
148
  else
@@ -10,7 +10,7 @@ module Sidekiq
10
10
 
11
11
  ##
12
12
  # The Manager is the central coordination point in Sidekiq, controlling
13
- # the lifecycle of the Processors and feeding them jobs as necessary.
13
+ # the lifecycle of the Processors.
14
14
  #
15
15
  # Tasks:
16
16
  #
@@ -162,7 +162,7 @@ module Sidekiq
162
162
  end
163
163
 
164
164
  def retry_attempts_from(msg_retry, default)
165
- if msg_retry.is_a?(Fixnum)
165
+ if msg_retry.is_a?(Integer)
166
166
  msg_retry
167
167
  else
168
168
  default
@@ -52,26 +52,30 @@ module Sidekiq
52
52
  Sidekiq.hook_rails!
53
53
  end
54
54
 
55
- # We have to add the reloader after initialize to see if cache_classes has
56
- # been turned on.
57
- #
58
- # This hook happens after all initialziers are run, just before returning
59
- # from config/environment.rb back to sidekiq/cli.rb.
60
55
  config.after_initialize do
61
- if ::Rails::VERSION::MAJOR >= 5
62
- # The reloader also takes care of ActiveRecord but is incompatible with
63
- # the ActiveRecord middleware so make sure it's not in the chain already.
64
- if defined?(Sidekiq::Middleware::Server::ActiveRecord) && Sidekiq.server_middleware.exists?(Sidekiq::Middleware::Server::ActiveRecord)
65
- raise ArgumentError, "You are using the Sidekiq ActiveRecord middleware and the new Rails 5 reloader which are incompatible. Please remove the ActiveRecord middleware from your Sidekiq middleware configuration."
66
- elsif ::Rails.application.config.cache_classes
67
- # The reloader API has proven to be troublesome under load in production.
68
- # We won't use it at all when classes are cached, see #3154
69
- Sidekiq.logger.debug { "Autoload disabled in #{::Rails.env}, Sidekiq will not reload changed classes" }
70
- Sidekiq.options[:executor] = Sidekiq::Rails::Executor.new
71
- else
72
- Sidekiq.logger.debug { "Enabling Rails 5+ live code reloading, so hot!" }
73
- Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
74
- Psych::Visitors::ToRuby.prepend(Sidekiq::Rails::PsychAutoload)
56
+ # This hook happens after all initializers are run, just before returning
57
+ # from config/environment.rb back to sidekiq/cli.rb.
58
+ # We have to add the reloader after initialize to see if cache_classes has
59
+ # been turned on.
60
+ #
61
+ # None of this matters on the client-side, only within the Sidekiq process itself.
62
+ #
63
+ Sidekiq.configure_server do |_|
64
+ if ::Rails::VERSION::MAJOR >= 5
65
+ # The reloader also takes care of ActiveRecord but is incompatible with
66
+ # the ActiveRecord middleware so make sure it's not in the chain already.
67
+ if defined?(Sidekiq::Middleware::Server::ActiveRecord) && Sidekiq.server_middleware.exists?(Sidekiq::Middleware::Server::ActiveRecord)
68
+ raise ArgumentError, "You are using the Sidekiq ActiveRecord middleware and the new Rails 5 reloader which are incompatible. Please remove the ActiveRecord middleware from your Sidekiq middleware configuration."
69
+ elsif ::Rails.application.config.cache_classes
70
+ # The reloader API has proven to be troublesome under load in production.
71
+ # We won't use it at all when classes are cached, see #3154
72
+ Sidekiq.logger.debug { "Autoload disabled in #{::Rails.env}, Sidekiq will not reload changed classes" }
73
+ Sidekiq.options[:executor] = Sidekiq::Rails::Executor.new
74
+ else
75
+ Sidekiq.logger.debug { "Enabling Rails 5+ live code reloading, so hot!" }
76
+ Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
77
+ Psych::Visitors::ToRuby.prepend(Sidekiq::Rails::PsychAutoload)
78
+ end
75
79
  end
76
80
  end
77
81
  end
@@ -67,7 +67,8 @@ module Sidekiq
67
67
  opts.delete(:network_timeout)
68
68
  end
69
69
 
70
- opts[:driver] = opts[:driver] || 'ruby'
70
+ opts[:driver] ||= 'ruby'
71
+ opts[:reconnect_attempts] ||= 0
71
72
 
72
73
  opts
73
74
  end
@@ -22,6 +22,7 @@ module Sidekiq
22
22
 
23
23
  def safe_thread(name, &block)
24
24
  Thread.new do
25
+ Thread.current['sidekiq_label'] = name
25
26
  watchdog(name, &block)
26
27
  end
27
28
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sidekiq
3
- VERSION = "4.2.7"
3
+ VERSION = "4.2.8"
4
4
  end
@@ -274,7 +274,7 @@ module Sidekiq
274
274
  resp = case resp
275
275
  when Array
276
276
  resp
277
- when Fixnum
277
+ when Integer
278
278
  [resp, {}, []]
279
279
  else
280
280
  type_header = case action.type
@@ -142,7 +142,8 @@ module Sidekiq
142
142
  end
143
143
 
144
144
  def relative_time(time)
145
- %{<time datetime="#{time.getutc.iso8601}">#{time}</time>}
145
+ stamp = time.getutc.iso8601
146
+ %{<time title="#{stamp}" datetime="#{stamp}">#{time}</time>}
146
147
  end
147
148
 
148
149
  def job_params(job, score)
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'concurrent-ruby', '~> 1.0'
21
21
  gem.add_dependency 'rack-protection', '>= 1.5.0'
22
22
  gem.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
23
- gem.add_development_dependency 'minitest', '~> 5.7', '>= 5.7.0'
23
+ gem.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.1'
24
24
  gem.add_development_dependency 'rake', '~> 10.0'
25
25
  gem.add_development_dependency 'rails', '>= 3.2.0'
26
26
  end
@@ -185,7 +185,7 @@ class TestCli < Sidekiq::Test
185
185
  assert_equal './test/config.yml', Sidekiq.options[:config_file]
186
186
  refute Sidekiq.options[:verbose]
187
187
  assert_equal './test/fake_env.rb', Sidekiq.options[:require]
188
- assert_equal nil, Sidekiq.options[:environment]
188
+ assert_nil Sidekiq.options[:environment]
189
189
  assert_equal 50, Sidekiq.options[:concurrency]
190
190
  assert_equal '/tmp/sidekiq-config-test.pid', Sidekiq.options[:pidfile]
191
191
  assert_equal '/tmp/sidekiq.log', Sidekiq.options[:logfile]
@@ -373,7 +373,7 @@ class TestCli < Sidekiq::Test
373
373
  @tmp_log_path = '/tmp/sidekiq.log'
374
374
  @cli.parse(['sidekiq', '-L', @tmp_log_path, '-r', './test/fake_env.rb'])
375
375
  @mock_thread = MiniTest::Mock.new
376
- @mock_thread.expect(:[], 'interrupt_test', ['label'])
376
+ @mock_thread.expect(:[], 'interrupt_test', ['sidekiq_label'])
377
377
  end
378
378
 
379
379
  after do
@@ -159,7 +159,7 @@ class TestClient < Sidekiq::Test
159
159
  chain.add Stopper
160
160
  end
161
161
 
162
- assert_equal nil, client.push('class' => MyWorker, 'args' => [0])
162
+ assert_nil client.push('class' => MyWorker, 'args' => [0])
163
163
  assert_match(/[0-9a-f]{12}/, client.push('class' => MyWorker, 'args' => [1]))
164
164
  client.push_bulk('class' => MyWorker, 'args' => [[0], [1]]).each do |jid|
165
165
  assert_match(/[0-9a-f]{12}/, jid)
@@ -5,30 +5,30 @@ require 'sidekiq/logging'
5
5
  class TestLogging < Sidekiq::Test
6
6
  describe Sidekiq::Logging do
7
7
  describe "#with_context" do
8
- def context
8
+ def ctx
9
9
  Sidekiq::Logging.logger.formatter.context
10
10
  end
11
11
 
12
12
  it "has no context by default" do
13
- context.must_equal nil
13
+ assert_nil ctx
14
14
  end
15
15
 
16
16
  it "can add a context" do
17
17
  Sidekiq::Logging.with_context "xx" do
18
- context.must_equal " xx"
18
+ assert_equal " xx", ctx
19
19
  end
20
- context.must_equal nil
20
+ assert_nil ctx
21
21
  end
22
22
 
23
23
  it "can use multiple contexts" do
24
24
  Sidekiq::Logging.with_context "xx" do
25
- context.must_equal " xx"
25
+ assert_equal " xx", ctx
26
26
  Sidekiq::Logging.with_context "yy" do
27
- context.must_equal " xx yy"
27
+ assert_equal " xx yy", ctx
28
28
  end
29
- context.must_equal " xx"
29
+ assert_equal " xx", ctx
30
30
  end
31
- context.must_equal nil
31
+ assert_nil ctx
32
32
  end
33
33
  end
34
34
  end
@@ -112,7 +112,7 @@ class TestMiddleware < Sidekiq::Test
112
112
 
113
113
  final_action = nil
114
114
  chain.invoke { final_action = true }
115
- assert_equal nil, final_action
115
+ assert_nil final_action
116
116
  assert_equal [], recorder
117
117
  end
118
118
  end
@@ -117,7 +117,7 @@ class TestRetryExhausted < Sidekiq::Test
117
117
 
118
118
  assert old_worker.exhausted_called?
119
119
  assert_equal raised_error.message, old_worker.exhausted_job['error_message']
120
- assert_equal nil, new_worker.exhausted_exception
120
+ assert_nil new_worker.exhausted_exception
121
121
  end
122
122
 
123
123
  it 'allows a global default handler' do
@@ -24,9 +24,9 @@
24
24
  <td>
25
25
  <% a = msg.display_args.inspect %>
26
26
  <% if a.size > 100 %>
27
- <%= h(msg.display_args.inspect[0..100]) + "... " %>
28
- <button data-toggle="collapse" data-target="#worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
29
- <div class="toggle" id="worker_<%= index %>"><%= h(msg.display_args) %></div>
27
+ <span class="worker_<%= index %>"><%= h(msg.display_args.inspect[0..100]) + "... " %></span>
28
+ <button data-toggle="collapse" data-target=".worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
29
+ <div class="toggle worker_<%= index %>"><%= h(msg.display_args) %></div>
30
30
  <% else %>
31
31
  <%= h(msg.display_args) %>
32
32
  <% end %>
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: 4.2.7
4
+ version: 4.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-28 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -104,20 +104,20 @@ dependencies:
104
104
  requirements:
105
105
  - - "~>"
106
106
  - !ruby/object:Gem::Version
107
- version: '5.7'
107
+ version: '5.10'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 5.7.0
110
+ version: 5.10.1
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '5.7'
117
+ version: '5.10'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 5.7.0
120
+ version: 5.10.1
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: rake
123
123
  requirement: !ruby/object:Gem::Requirement