sidekiq 2.17.3 → 2.17.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
  SHA1:
3
- metadata.gz: b68667363a8350377be91d5594c81b4ee780e020
4
- data.tar.gz: 0271205154c7e94ed068e0336edb62f63c174552
3
+ metadata.gz: f0aa7427773926eb8405b61c3f23ca7f76d2c30a
4
+ data.tar.gz: 4718ae00e33055fa689059cbfa1f9ef376849109
5
5
  SHA512:
6
- metadata.gz: 340d77c4c89ae83686d3138668e5dace15433185984910e2b408ea3d28ef269db4d61d3ad70eee0f0f1db86e731da648b98e3bb9109add6761114eedb9712de0
7
- data.tar.gz: d9db8af31e75b3a3739e31869f96703721056ac1b4958f21dffe538d4afa1f3f41e7dcf05edd21e899e0ee3ae1335704f33970d445afa928c883fac1ff0fbe4e
6
+ metadata.gz: fc0f9e9373b76a5c9944e00de83edada7a886181d49ce11f70582cb6a8f2c35514d350dd6987d26abbe92ae91639661d414be1ba76e6f509577fb461c2396319
7
+ data.tar.gz: d6efd568f255aac569dc64f9de9fe73984a76aaf72413551f977ba1f2037eee4dfc7350209d06bf66fc19a3ab5e8b250985ff27eff3cec8d8ccfcbc494c14d10
@@ -6,8 +6,6 @@ This is a license agreement and not an agreement for sale. We reserve ownership
6
6
 
7
7
  Subject to the payment of the fee required and subject to the terms and conditions of this License Agreement, We grant to You a revocable, non- transferable and non-exclusive license (i) for Designated User(s) (as defined below) within Your organization to install and use the Software on any workstations used exclusively by such Designated User and (ii) for You to install and use the Software in connection with unlimited domains and sub-domains on unlimited servers, solely in connection with distribution of the Software in accordance with sections 3 and 4 below. This license is not sublicensable except as explicitly set forth herein. “Designated User(s)” shall mean Your employee(s) acting within the scope of their employment or Your consultant(s) or contractor(s) acting within the scope of the services they provide for You or on Your behalf for whom You have purchased a license to use the Software.
8
8
 
9
- In addition to the other terms contained herein, We grant to You a revocable, non- transferable and non-exclusive license to install and use the Software on a single computer (the “Trial License”) strictly for Your internal evaluation and review purposes and not for production purposes. This Trial License applies only if You have registered with Us for a Trial License of the Software and shall be effective for forty-five (45) consecutive days following the date of registration (“the Trial Period”). You may only register for a Trial License once in any eighteen month period. You agree not to use a Trial License for any purpose other than determining whether to purchase a license to the Software. You are explicitly not permitted to distribute the Software to any user outside the Organization on whose behalf you have undertaken this license. Your rights to use the Trial License will immediately terminate upon the earlier of (i) the expiration of the Trial Period, or (ii) such time that You purchase a license to the Software. We reserve the right to terminate Your Trial License at any time in Our absolute and sole discretion.
10
-
11
9
  2. PERMITTED USES, SOURCE CODE, MODIFICATIONS
12
10
 
13
11
  We provide You with source code so that You can create Modifications of the original Software, where Modification means: a) any addition to or deletion from the contents of a file included in the original Software or previous Modifications created by You, or b) any new file that contains any part of the original Software or previous Modifications. While You retain all rights to any original work authored by You as part of the Modifications, We continue to own all copyright and other intellectual property rights in the Software.
@@ -24,6 +22,8 @@ You will not owe Us any royalties for Your distribution of the Software in accor
24
22
 
25
23
  You may not, without Our prior written consent, redistribute the Software or Modifications other than by including the Software or a portion thereof within Your own product, which must have substantially different functionality than the Software or Modifications and must not allow any third party to use the Software or Modifications, or any portions thereof, for software development or application development purposes. You are explicitly not allowed to redistribute the Software or Modifications as part of any product that can be described as a development toolkit or library, an application builder, a website builder or any product that is intended for use by software, application, or website developers or designers. You are not allowed to redistribute any part of the Software documentation. You may not change or remove the copyright notice from any of the files included in the Software or Modifications.
26
24
 
25
+ You may not redistribute the Software as part of a product, "appliance" or "virtual server". You may not redistribute the Software on any server which is not directly under Your control.
26
+
27
27
  UNDER NO CIRCUMSTANCES MAY YOU USE THE SOFTWARE FOR A PRODUCT THAT IS INTENDED FOR SOFTWARE OR APPLICATION DEVELOPMENT PURPOSES.
28
28
 
29
29
  The Open Source version of the Software (“LGPL Version”) is licensed
data/Changes.md CHANGED
@@ -1,15 +1,27 @@
1
+ 2.17.4
2
+ -----------
3
+
4
+ - Fix JID support in inline testing, #1454
5
+ - Polish worker arguments display in UI, #1453
6
+ - Marshal arguments fully to avoid worker mutation, #1452
7
+ - Support reverse paging sorted sets, #1098
8
+
9
+
1
10
  2.17.3
2
11
  -----------
3
12
 
4
- - Synchronously shut down Fetcher and Poller to ensure they don't deliver
5
- jobs after Manager is shut down. [#1423]
13
+ - Synchronously terminates the poller and fetcher to fix a race condition in bulk requeue during shutdown [#1406]
6
14
 
7
15
  2.17.2
8
16
  -----------
9
17
 
10
- - Fix race condition in bulk requeue during shutdown [#1406]
11
18
  - Fix bug where strictly prioritized queues might be processed out of
12
- order [#1408]
19
+ order [#1408]. A side effect of this change is that it breaks a queue
20
+ declaration syntax that worked, although only because of a bug—it was
21
+ never intended to work and never supported. If you were declaring your
22
+ queues as a comma-separated list, e.g. `sidekiq -q critical,default,low`,
23
+ you must now use the `-q` flag before each queue, e.g.
24
+ `sidekiq -q critical -q default -q low`.
13
25
 
14
26
  2.17.1
15
27
  -----------
@@ -3,6 +3,12 @@ Sidekiq Pro Changelog
3
3
 
4
4
  Please see [http://sidekiq.org/pro](http://sidekiq.org/pro) for more details and how to buy.
5
5
 
6
+ 1.4.2
7
+ -----------
8
+
9
+ - Tolerate expired Batches in the web UI.
10
+ - Fix 100% CPU usage when using weighted queues and reliable fetch.
11
+
6
12
  1.4.1
7
13
  -----------
8
14
 
@@ -1,6 +1,6 @@
1
1
  module Sidekiq
2
2
  module Paginator
3
- def page(key, pageidx=1, page_size=25)
3
+ def page(key, pageidx=1, page_size=25, opts=nil)
4
4
  current_page = pageidx.to_i < 1 ? 1 : pageidx.to_i
5
5
  pageidx = current_page - 1
6
6
  total_size = 0
@@ -13,11 +13,20 @@ module Sidekiq
13
13
 
14
14
  case type
15
15
  when 'zset'
16
- total_size = conn.zcard(key)
17
- items = conn.zrange(key, starting, ending, :with_scores => true)
16
+ rev = opts.try(:[], :reverse)
17
+ total_size, items = conn.multi do
18
+ conn.zcard(key)
19
+ if rev
20
+ conn.zrevrange(key, starting, ending, :with_scores => true)
21
+ else
22
+ conn.zrange(key, starting, ending, :with_scores => true)
23
+ end
24
+ end
18
25
  when 'list'
19
- total_size = conn.llen(key)
20
- items = conn.lrange(key, starting, ending)
26
+ total_size, items = conn.multi do
27
+ conn.llen(key)
28
+ conn.lrange(key, starting, ending)
29
+ end
21
30
  when 'none'
22
31
  return [1, 0, []]
23
32
  else
@@ -131,13 +131,11 @@ module Sidekiq
131
131
  # Singleton classes are not clonable.
132
132
  SINGLETON_CLASSES = [ NilClass, TrueClass, FalseClass, Symbol, Fixnum, Float, Bignum ].freeze
133
133
 
134
- # Clone the arguments passed to the worker so that if
134
+ # Deep clone the arguments passed to the worker so that if
135
135
  # the message fails, what is pushed back onto Redis hasn't
136
136
  # been mutated by the worker.
137
137
  def cloned(ary)
138
- ary.map do |val|
139
- SINGLETON_CLASSES.include?(val.class) ? val : val.clone
140
- end
138
+ Marshal.load(Marshal.dump(ary))
141
139
  end
142
140
  end
143
141
  end
@@ -10,7 +10,7 @@ namespace :load do
10
10
  set :sidekiq_cmd, ->{ }
11
11
  set :sidekiqctl_cmd, ->{ }
12
12
 
13
- # must be relative to Rails.root. If this changes, you'll need to manually
13
+ # If this changes, you'll need to manually
14
14
  # stop the existing sidekiq process.
15
15
  set :sidekiq_pid, ->{ "tmp/sidekiq.pid" }
16
16
 
@@ -36,6 +36,14 @@ namespace :sidekiq do
36
36
  end
37
37
  end
38
38
 
39
+ def pid_full_path(pid_path)
40
+ if pid_path.start_with?("/")
41
+ pid_path
42
+ else
43
+ "#{current_path}/#{pid_path}"
44
+ end
45
+ end
46
+
39
47
  task :add_default_hooks do
40
48
  after 'deploy:starting', 'sidekiq:quiet'
41
49
  after 'deploy:updated', 'sidekiq:stop'
@@ -47,12 +55,12 @@ namespace :sidekiq do
47
55
  task :quiet do
48
56
  on roles fetch(:sidekiq_role) do
49
57
  for_each_process do |pid_file, idx|
50
- if test "[ -f #{current_path}/#{pid_file} ]"
58
+ if test "[ -f #{pid_full_path(pid_file)} ]"
51
59
  within current_path do
52
60
  if fetch(:sidekiqctl_cmd)
53
- execute fetch(:sidekiqctl_cmd), 'quiet', "#{current_path}/#{pid_file}"
61
+ execute fetch(:sidekiqctl_cmd), 'quiet', "#{pid_full_path(pid_file)}"
54
62
  else
55
- execute :bundle, :exec, :sidekiqctl, 'quiet', "#{current_path}/#{pid_file}"
63
+ execute :bundle, :exec, :sidekiqctl, 'quiet', "#{pid_full_path(pid_file)}"
56
64
  end
57
65
  end
58
66
  end
@@ -64,12 +72,12 @@ namespace :sidekiq do
64
72
  task :stop do
65
73
  on roles fetch(:sidekiq_role) do
66
74
  for_each_process do |pid_file, idx|
67
- if test "[ -f #{current_path}/#{pid_file} ]"
75
+ if test "[ -f #{pid_full_path(pid_file)} ]"
68
76
  within current_path do
69
77
  if fetch(:sidekiqctl_cmd)
70
- execute fetch(:sidekiqctl_cmd), 'stop', "#{current_path}/#{pid_file}", fetch(:sidekiq_timeout)
78
+ execute fetch(:sidekiqctl_cmd), 'stop', "#{pid_full_path(pid_file)}", fetch(:sidekiq_timeout)
71
79
  else
72
- execute :bundle, :exec, :sidekiqctl, 'stop', "#{current_path}/#{pid_file}", fetch(:sidekiq_timeout)
80
+ execute :bundle, :exec, :sidekiqctl, 'stop', "#{pid_full_path(pid_file)}", fetch(:sidekiq_timeout)
73
81
  end
74
82
  end
75
83
  end
@@ -84,9 +92,9 @@ namespace :sidekiq do
84
92
  within current_path do
85
93
  for_each_process do |pid_file, idx|
86
94
  if fetch(:sidekiq_cmd)
87
- execute fetch(:sidekiq_cmd), "-d -i #{idx} -P #{pid_file} #{fetch(:sidekiq_options)}"
95
+ execute fetch(:sidekiq_cmd), "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
88
96
  else
89
- execute :bundle, :exec, :sidekiq, "-d -i #{idx} -P #{pid_file} #{fetch(:sidekiq_options)}"
97
+ execute :bundle, :exec, :sidekiq, "-d -i #{idx} -P #{pid_full_path(pid_file)} #{fetch(:sidekiq_options)}"
90
98
  end
91
99
  end
92
100
  end
@@ -1,3 +1,5 @@
1
+ require 'securerandom'
2
+
1
3
  module Sidekiq
2
4
 
3
5
  class Testing
@@ -64,8 +66,11 @@ module Sidekiq
64
66
  true
65
67
  elsif Sidekiq::Testing.inline?
66
68
  payloads.each do |item|
69
+ jid = item['jid'] || SecureRandom.hex(12)
67
70
  marshalled = Sidekiq.load_json(Sidekiq.dump_json(item))
68
- marshalled['class'].constantize.new.perform(*marshalled['args'])
71
+ worker = marshalled['class'].constantize.new
72
+ worker.jid = jid
73
+ worker.perform(*marshalled['args'])
69
74
  end
70
75
  true
71
76
  else
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "2.17.3"
2
+ VERSION = "2.17.4"
3
3
  end
@@ -17,6 +17,7 @@ class TestInline < Sidekiq::Test
17
17
  class InlineWorker
18
18
  include Sidekiq::Worker
19
19
  def perform(pass)
20
+ raise ArgumentError, "no jid" unless jid
20
21
  raise InlineError unless pass
21
22
  end
22
23
  end
@@ -12,16 +12,9 @@
12
12
  <td>
13
13
  <a href="<%= root_path %>queues/<%= msg['queue'] %>"><%= msg['queue'] %></a>
14
14
  </td>
15
-
16
15
  <td><%= msg['payload']['class'] %></td>
17
16
  <td>
18
- <% if msg['payload']['args'].to_s.size > 100 %>
19
- <%= h(msg['payload']['args'].inspect[0..100]) + "... " %>
20
- <button data-toggle="collapse" data-target="#worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
21
- <div class="toggle" id="worker_<%= index %>" style="display: none;max-width: 750px;"><%= h(msg['payload']['args']) %></div>
22
- <% else %>
23
- <%= h(msg['payload']['args']) %>
24
- <% end %>
17
+ <div class="args"><%= display_args(msg['payload']['args']) %></div>
25
18
  </td>
26
19
  <td><%= relative_time(msg['run_at'].is_a?(Numeric) ? Time.at(msg['run_at']) : Time.parse(msg['run_at'])) %></td>
27
20
  </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: 2.17.3
4
+ version: 2.17.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: 2014-01-16 00:00:00.000000000 Z
11
+ date: 2014-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis