sidekiq 6.0.3 → 6.0.4

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
  SHA256:
3
- metadata.gz: 289abeb95ea2defd87dce17b31747cc56193a3e606e7f1f87d9ab237706526cc
4
- data.tar.gz: a9ee206b90eb90737d587da3033559f96150aaceda8b0d319fcca29a08507c56
3
+ metadata.gz: 6bfe129c0a4abfedbab370011613f8acefe77791327e85993a4048be63507a6d
4
+ data.tar.gz: 2a67cee7d61bf27ef76fb54fe077b981de6c9286c3e46dc7303e47a31087fb54
5
5
  SHA512:
6
- metadata.gz: b9feed82f74bad9ae58674c373286522df5c2198ec4f685a777fc8ad2dd89f4f985dcfc81a1f915e77ae806e3fab060f5e662fd8378a4efc951da6b230ae3cd4
7
- data.tar.gz: 1928083cc83adc9a248f6b9f9a5cd95c91b6a4a5c324cb38d4082309cf801031ac2f644a9f1aef3d7c49424dd4525da870af72e892f983c35cb07e4a214aa311
6
+ metadata.gz: a989ad41c075a9c7accf401d14da3ef28c836668a9e3f49ec09a61f7114b7198c3485ded79c06fa4bb3f3c22271db9a7eaae0f156667d400178d26d6055e7ef0
7
+ data.tar.gz: f7200ade5b0f69f2ffbc8c708ed28d0efff3f6b6708ecdbe60ec22903ef2c58a78f362fc8a59540b045d17d91a0e19adbd647dbddd0a166f530087908715337d
@@ -10,7 +10,7 @@ This release has major breaking changes. Read and test carefully in production.
10
10
  - ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
11
11
  features/internals like the retry subsystem. Prefer the native
12
12
  Sidekiq::Worker APIs as some Sidekiq features (e.g. unique jobs) do not work well with AJ.
13
- (requires Rails 6.0.1)
13
+ (requires Rails 6.0.2)
14
14
  ```ruby
15
15
  class MyJob < ActiveJob::Base
16
16
  queue_as :myqueue
data/Changes.md CHANGED
@@ -2,6 +2,15 @@
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
+ 6.0.4
6
+ ---------
7
+
8
+ - Fix ActiveJob's `sidekiq_options` integration [#4404]
9
+ - Sidekiq Pro users will now see a Pause button next to each queue in
10
+ the Web UI, allowing them to pause queues manually [#4374, shayonj]
11
+ - Fix Sidekiq::Workers API unintentional change in 6.0.2 [#4387]
12
+
13
+
5
14
  6.0.3
6
15
  ---------
7
16
 
@@ -13,7 +13,7 @@ Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how t
13
13
  2.0.0
14
14
  -------------
15
15
 
16
- - Except for the [newly required credentials](/mperham/sidekiq/issue/4232), Sidekiq Enterprise 2.0 does
16
+ - Except for the [newly required credentials](https://github.com/mperham/sidekiq/issues/4232), Sidekiq Enterprise 2.0 does
17
17
  not have any significant migration steps.
18
18
  - Sidekiq Enterprise must now be started with valid license credentials. [#4232]
19
19
  - Call `GC.compact` if possible in sidekiqswarm before forking [#4181]
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ gemspec
4
4
 
5
5
  gem "rake"
6
6
  gem "redis-namespace"
7
- gem "rails"
7
+ gem "rails", ">= 6.0.2"
8
8
  gem "sqlite3", platforms: :ruby
9
9
  gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
10
10
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq (6.0.2)
4
+ sidekiq (6.0.4)
5
5
  connection_pool (>= 2.2.2)
6
6
  rack (>= 2.0.0)
7
7
  rack-protection (>= 2.0.0)
@@ -10,78 +10,78 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (6.0.0)
14
- actionpack (= 6.0.0)
13
+ actioncable (6.0.2)
14
+ actionpack (= 6.0.2)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (6.0.0)
18
- actionpack (= 6.0.0)
19
- activejob (= 6.0.0)
20
- activerecord (= 6.0.0)
21
- activestorage (= 6.0.0)
22
- activesupport (= 6.0.0)
17
+ actionmailbox (6.0.2)
18
+ actionpack (= 6.0.2)
19
+ activejob (= 6.0.2)
20
+ activerecord (= 6.0.2)
21
+ activestorage (= 6.0.2)
22
+ activesupport (= 6.0.2)
23
23
  mail (>= 2.7.1)
24
- actionmailer (6.0.0)
25
- actionpack (= 6.0.0)
26
- actionview (= 6.0.0)
27
- activejob (= 6.0.0)
24
+ actionmailer (6.0.2)
25
+ actionpack (= 6.0.2)
26
+ actionview (= 6.0.2)
27
+ activejob (= 6.0.2)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.0.0)
31
- actionview (= 6.0.0)
32
- activesupport (= 6.0.0)
30
+ actionpack (6.0.2)
31
+ actionview (= 6.0.2)
32
+ activesupport (= 6.0.2)
33
33
  rack (~> 2.0)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.0.0)
38
- actionpack (= 6.0.0)
39
- activerecord (= 6.0.0)
40
- activestorage (= 6.0.0)
41
- activesupport (= 6.0.0)
37
+ actiontext (6.0.2)
38
+ actionpack (= 6.0.2)
39
+ activerecord (= 6.0.2)
40
+ activestorage (= 6.0.2)
41
+ activesupport (= 6.0.2)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.0.0)
44
- activesupport (= 6.0.0)
43
+ actionview (6.0.2)
44
+ activesupport (= 6.0.2)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.0.0)
50
- activesupport (= 6.0.0)
49
+ activejob (6.0.2)
50
+ activesupport (= 6.0.2)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.0.0)
53
- activesupport (= 6.0.0)
54
- activerecord (6.0.0)
55
- activemodel (= 6.0.0)
56
- activesupport (= 6.0.0)
57
- activestorage (6.0.0)
58
- actionpack (= 6.0.0)
59
- activejob (= 6.0.0)
60
- activerecord (= 6.0.0)
52
+ activemodel (6.0.2)
53
+ activesupport (= 6.0.2)
54
+ activerecord (6.0.2)
55
+ activemodel (= 6.0.2)
56
+ activesupport (= 6.0.2)
57
+ activestorage (6.0.2)
58
+ actionpack (= 6.0.2)
59
+ activejob (= 6.0.2)
60
+ activerecord (= 6.0.2)
61
61
  marcel (~> 0.3.1)
62
- activesupport (6.0.0)
62
+ activesupport (6.0.2)
63
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
64
64
  i18n (>= 0.7, < 2)
65
65
  minitest (~> 5.1)
66
66
  tzinfo (~> 1.1)
67
- zeitwerk (~> 2.1, >= 2.1.8)
67
+ zeitwerk (~> 2.2)
68
68
  ast (2.4.0)
69
- builder (3.2.3)
69
+ builder (3.2.4)
70
70
  byebug (11.0.1)
71
71
  coderay (1.1.2)
72
72
  concurrent-ruby (1.1.5)
73
73
  connection_pool (2.2.2)
74
- crass (1.0.4)
74
+ crass (1.0.5)
75
75
  docile (1.3.2)
76
- erubi (1.8.0)
76
+ erubi (1.9.0)
77
77
  globalid (0.4.2)
78
78
  activesupport (>= 4.2.0)
79
79
  hiredis (0.6.3)
80
- i18n (1.6.0)
80
+ i18n (1.7.0)
81
81
  concurrent-ruby (~> 1.0)
82
- jaro_winkler (1.5.3)
82
+ jaro_winkler (1.5.4)
83
83
  json (2.2.0)
84
- loofah (2.2.3)
84
+ loofah (2.4.0)
85
85
  crass (~> 1.0.2)
86
86
  nokogiri (>= 1.5.9)
87
87
  mail (2.7.1)
@@ -93,11 +93,11 @@ GEM
93
93
  mini_mime (1.0.2)
94
94
  mini_portile2 (2.4.0)
95
95
  minitest (5.11.3)
96
- nio4r (2.5.1)
97
- nokogiri (1.10.4)
96
+ nio4r (2.5.2)
97
+ nokogiri (1.10.7)
98
98
  mini_portile2 (~> 2.4.0)
99
- parallel (1.17.0)
100
- parser (2.6.4.1)
99
+ parallel (1.19.0)
100
+ parser (2.6.5.0)
101
101
  ast (~> 2.4.0)
102
102
  pry (0.12.2)
103
103
  coderay (~> 1.1.0)
@@ -110,29 +110,29 @@ GEM
110
110
  rack
111
111
  rack-test (1.1.0)
112
112
  rack (>= 1.0, < 3)
113
- rails (6.0.0)
114
- actioncable (= 6.0.0)
115
- actionmailbox (= 6.0.0)
116
- actionmailer (= 6.0.0)
117
- actionpack (= 6.0.0)
118
- actiontext (= 6.0.0)
119
- actionview (= 6.0.0)
120
- activejob (= 6.0.0)
121
- activemodel (= 6.0.0)
122
- activerecord (= 6.0.0)
123
- activestorage (= 6.0.0)
124
- activesupport (= 6.0.0)
113
+ rails (6.0.2)
114
+ actioncable (= 6.0.2)
115
+ actionmailbox (= 6.0.2)
116
+ actionmailer (= 6.0.2)
117
+ actionpack (= 6.0.2)
118
+ actiontext (= 6.0.2)
119
+ actionview (= 6.0.2)
120
+ activejob (= 6.0.2)
121
+ activemodel (= 6.0.2)
122
+ activerecord (= 6.0.2)
123
+ activestorage (= 6.0.2)
124
+ activesupport (= 6.0.2)
125
125
  bundler (>= 1.3.0)
126
- railties (= 6.0.0)
126
+ railties (= 6.0.2)
127
127
  sprockets-rails (>= 2.0.0)
128
128
  rails-dom-testing (2.0.3)
129
129
  activesupport (>= 4.2.0)
130
130
  nokogiri (>= 1.6)
131
- rails-html-sanitizer (1.2.0)
132
- loofah (~> 2.2, >= 2.2.2)
133
- railties (6.0.0)
134
- actionpack (= 6.0.0)
135
- activesupport (= 6.0.0)
131
+ rails-html-sanitizer (1.3.0)
132
+ loofah (~> 2.3)
133
+ railties (6.0.2)
134
+ actionpack (= 6.0.2)
135
+ activesupport (= 6.0.2)
136
136
  method_source
137
137
  rake (>= 0.8.7)
138
138
  thor (>= 0.20.3, < 2.0)
@@ -141,14 +141,14 @@ GEM
141
141
  redis (4.1.2)
142
142
  redis-namespace (1.6.0)
143
143
  redis (>= 3.0.4)
144
- rubocop (0.72.0)
144
+ rubocop (0.75.1)
145
145
  jaro_winkler (~> 1.5.1)
146
146
  parallel (~> 1.10)
147
147
  parser (>= 2.6)
148
148
  rainbow (>= 2.2.2, < 4.0)
149
149
  ruby-progressbar (~> 1.7)
150
150
  unicode-display_width (>= 1.4.0, < 1.7)
151
- rubocop-performance (1.4.1)
151
+ rubocop-performance (1.5.1)
152
152
  rubocop (>= 0.71.0)
153
153
  ruby-progressbar (1.10.1)
154
154
  simplecov (0.17.0)
@@ -156,7 +156,7 @@ GEM
156
156
  json (>= 1.8, < 3)
157
157
  simplecov-html (~> 0.10.0)
158
158
  simplecov-html (0.10.2)
159
- sprockets (3.7.2)
159
+ sprockets (4.0.0)
160
160
  concurrent-ruby (~> 1.0)
161
161
  rack (> 1, < 3)
162
162
  sprockets-rails (3.2.1)
@@ -164,10 +164,10 @@ GEM
164
164
  activesupport (>= 4.0)
165
165
  sprockets (>= 3.0.0)
166
166
  sqlite3 (1.4.1)
167
- standard (0.1.4)
168
- rubocop (~> 0.72.0)
169
- rubocop-performance (~> 1.4.0)
170
- thor (0.20.3)
167
+ standard (0.1.6)
168
+ rubocop (~> 0.75.0)
169
+ rubocop-performance (~> 1.5.0)
170
+ thor (1.0.1)
171
171
  thread_safe (0.3.6)
172
172
  toxiproxy (1.0.3)
173
173
  tzinfo (1.2.5)
@@ -176,7 +176,7 @@ GEM
176
176
  websocket-driver (0.7.1)
177
177
  websocket-extensions (>= 0.1.0)
178
178
  websocket-extensions (0.1.4)
179
- zeitwerk (2.1.9)
179
+ zeitwerk (2.2.2)
180
180
 
181
181
  PLATFORMS
182
182
  ruby
@@ -186,7 +186,7 @@ DEPENDENCIES
186
186
  hiredis
187
187
  minitest
188
188
  pry-byebug
189
- rails
189
+ rails (>= 6.0.2)
190
190
  rake
191
191
  redis-namespace
192
192
  sidekiq!
@@ -194,3 +194,6 @@ DEPENDENCIES
194
194
  sqlite3
195
195
  standard
196
196
  toxiproxy
197
+
198
+ BUNDLED WITH
199
+ 1.17.2
@@ -18,7 +18,7 @@ module Sidekiq
18
18
  def create_test_file
19
19
  return unless test_framework
20
20
 
21
- if defined?(RSpec)
21
+ if test_framework == :rspec
22
22
  create_worker_spec
23
23
  else
24
24
  create_worker_test
@@ -210,6 +210,10 @@ module Sidekiq
210
210
  @logger = logger
211
211
  end
212
212
 
213
+ def self.pro?
214
+ defined?(Sidekiq::Pro)
215
+ end
216
+
213
217
  # How frequently Redis should be checked by a random Sidekiq process for
214
218
  # scheduled and retriable jobs. Each individual process will take turns by
215
219
  # waiting some multiple of this value.
@@ -926,7 +926,11 @@ module Sidekiq
926
926
  }
927
927
  next unless valid
928
928
  workers.each_pair do |tid, json|
929
- yield key, tid, Sidekiq.load_json(json)
929
+ hsh = Sidekiq.load_json(json)
930
+ p = hsh["payload"]
931
+ # avoid breaking API, this is a side effect of the JSON optimization in #4316
932
+ hsh["payload"] = Sidekiq.load_json(p) if p.is_a?(String)
933
+ yield key, tid, hsh
930
934
  end
931
935
  end
932
936
  end
@@ -38,6 +38,7 @@ module Sidekiq
38
38
  if environment == "development" && $stdout.tty? && Sidekiq.log_formatter.is_a?(Sidekiq::Logger::Formatters::Pretty)
39
39
  print_banner
40
40
  end
41
+ logger.info "Booted Rails #{::Rails.version} application in #{environment} environment" if rails_app?
41
42
 
42
43
  self_read, self_write = IO.pipe
43
44
  sigs = %w[INT TERM TTIN TSTP]
@@ -378,5 +379,9 @@ module Sidekiq
378
379
  [weight.to_i, 1].max.times { opts[:queues] << queue }
379
380
  opts[:strict] = false if weight.to_i > 0
380
381
  end
382
+
383
+ def rails_app?
384
+ defined?(::Rails)
385
+ end
381
386
  end
382
387
  end
@@ -230,13 +230,17 @@ module Sidekiq
230
230
  raise(ArgumentError, "Job tags must be an Array") if item["tags"] && !item["tags"].is_a?(Array)
231
231
  # raise(ArgumentError, "Arguments must be native JSON types, see https://github.com/mperham/sidekiq/wiki/Best-Practices") unless JSON.load(JSON.dump(item['args'])) == item['args']
232
232
 
233
- normalized_hash(item["class"])
234
- .each { |key, value| item[key] = value if item[key].nil? }
233
+ # merge in the default sidekiq_options for the item's class and/or wrapped element
234
+ # this allows ActiveJobs to control sidekiq_options too.
235
+ defaults = normalized_hash(item["class"])
236
+ defaults = defaults.merge(item["wrapped"].get_sidekiq_options) if item["wrapped"].respond_to?("get_sidekiq_options")
237
+ item = defaults.merge(item)
235
238
 
236
239
  item["class"] = item["class"].to_s
237
240
  item["queue"] = item["queue"].to_s
238
241
  item["jid"] ||= SecureRandom.hex(12)
239
242
  item["created_at"] ||= Time.now.to_f
243
+
240
244
  item
241
245
  end
242
246
 
@@ -189,13 +189,13 @@ module Sidekiq
189
189
  handle_exception(e, {context: "Error calling retries_exhausted", job: msg})
190
190
  end
191
191
 
192
+ send_to_morgue(msg) unless msg["dead"] == false
193
+
192
194
  Sidekiq.death_handlers.each do |handler|
193
195
  handler.call(msg, exception)
194
196
  rescue => e
195
197
  handle_exception(e, {context: "Error calling death handler", job: msg})
196
198
  end
197
-
198
- send_to_morgue(msg) unless msg["dead"] == false
199
199
  end
200
200
 
201
201
  def send_to_morgue(msg)
@@ -103,6 +103,9 @@ module Sidekiq
103
103
  if scrubbed_options[:password]
104
104
  scrubbed_options[:password] = redacted
105
105
  end
106
+ scrubbed_options[:sentinels]&.each do |sentinel|
107
+ sentinel[:password] = redacted if sentinel[:password]
108
+ end
106
109
  if Sidekiq.server?
107
110
  Sidekiq.logger.info("Booting Sidekiq #{Sidekiq::VERSION} with redis options #{scrubbed_options}")
108
111
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "6.0.3"
4
+ VERSION = "6.0.4"
5
5
  end
@@ -90,7 +90,15 @@ module Sidekiq
90
90
  end
91
91
 
92
92
  post "/queues/:name" do
93
- Sidekiq::Queue.new(route_params[:name]).clear
93
+ queue = Sidekiq::Queue.new(route_params[:name])
94
+
95
+ if Sidekiq.pro? && params["pause"]
96
+ queue.pause!
97
+ elsif Sidekiq.pro? && params["unpause"]
98
+ queue.unpause!
99
+ else
100
+ queue.clear
101
+ end
94
102
 
95
103
  redirect "#{root_path}queues"
96
104
  end
@@ -79,3 +79,5 @@ en: # <---- change this to your locale code
79
79
  CreatedAt: Created At
80
80
  BackToApp: Back to App
81
81
  Latency: Latency
82
+ Pause: Pause
83
+ Unpause: Unpause
@@ -22,6 +22,14 @@
22
22
  <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post">
23
23
  <%= csrf_tag %>
24
24
  <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
25
+
26
+ <% if Sidekiq.pro? %>
27
+ <% if queue.paused? %>
28
+ <input class="btn btn-danger btn-xs" type="submit" name="unpause" value="<%= t('Unpause') %>" />
29
+ <% else %>
30
+ <input class="btn btn-danger btn-xs" type="submit" name="pause" value="<%= t('Pause') %>" />
31
+ <% end %>
32
+ <% end %>
25
33
  </form>
26
34
  </td>
27
35
  </tr>
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: 6.0.3
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis