sidekiq 4.1.2 → 4.1.3
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 +4 -4
- data/.github/issue_template.md +4 -0
- data/4.0-Upgrade.md +3 -0
- data/Changes.md +30 -1
- data/Ent-Changes.md +7 -1
- data/Pro-Changes.md +20 -0
- data/lib/sidekiq/client.rb +1 -0
- data/lib/sidekiq/launcher.rb +2 -2
- data/lib/sidekiq/redis_connection.rb +5 -3
- data/lib/sidekiq/version.rb +1 -1
- data/sidekiq.gemspec +1 -1
- data/test/test_client.rb +4 -0
- data/test/test_redis_connection.rb +6 -1
- data/web/assets/javascripts/locales/{jquery.timeago.no.js → jquery.timeago.nb.js} +1 -1
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77c9c265afa18620c059fe584f8925ffaa094684
|
4
|
+
data.tar.gz: 4bce31343a0b697595307f281c959845e5bf810c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c8cca245d7123e6664c6d182c9e452c31895e3691f370c50661a180d0e3aa6b154ca66cde78b95ffaedf031b04a2d0dbc0ce99e82ffc66e82c3ea1e02b2ecc1
|
7
|
+
data.tar.gz: df0969715c7789e9793288c57fbeae8d74bf4fb192d0dee73bb106fae627fbc5e6b9bc07ce0d718e4ec30d3bed6f9d84aa511e8f7e795087b5f664ba2116f46b
|
data/4.0-Upgrade.md
CHANGED
@@ -25,6 +25,9 @@ gem 'redis-namespace'
|
|
25
25
|
`concurrency + 2` connections in your pool or Sidekiq will exit.
|
26
26
|
When in doubt, let Sidekiq size the connection pool for you.
|
27
27
|
|
28
|
+
* Worker data is no longer updated in real-time but rather upon every
|
29
|
+
heartbeat. Don't expect the `Sidekiq::Workers` API to be millisecond-precise.
|
30
|
+
|
28
31
|
* There's a new testing API based off the `Sidekiq::Queues` namespace. All
|
29
32
|
assertions made against the Worker class still work as expected.
|
30
33
|
```ruby
|
data/Changes.md
CHANGED
@@ -1,9 +1,38 @@
|
|
1
1
|
# Sidekiq Changes
|
2
2
|
|
3
|
+
4.1.3
|
4
|
+
-----------
|
5
|
+
|
6
|
+
- Sinatra 1.4.x is now a required dependency, avoiding cryptic errors
|
7
|
+
and old bugs due to people not upgrading Sinatra for years. [#3042]
|
8
|
+
- Fixed race condition in heartbeat which could rarely lead to lingering
|
9
|
+
processes on the Busy tab. [#2982]
|
10
|
+
```ruby
|
11
|
+
# To clean up lingering processes, modify this as necessary to connect to your Redis.
|
12
|
+
# After 60 seconds, lingering processes should disappear from the Busy page.
|
13
|
+
|
14
|
+
require 'redis'
|
15
|
+
r = Redis.new(url: "redis://localhost:6379/0")
|
16
|
+
# uncomment if you need a namespace
|
17
|
+
#require 'redis-namespace'
|
18
|
+
#r = Redis::Namespace.new("foo", r)
|
19
|
+
r.smembers("processes").each do |pro|
|
20
|
+
r.expire(pro, 60)
|
21
|
+
r.expire("#{pro}:workers", 60)
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
|
3
26
|
4.1.2
|
4
27
|
-----------
|
5
28
|
|
6
|
-
-
|
29
|
+
- Fix Redis data leak with worker data when a busy Sidekiq process
|
30
|
+
crashes. You can find and expire leaked data in Redis with this
|
31
|
+
script:
|
32
|
+
```bash
|
33
|
+
$ redis-cli keys "*:workers" | while read LINE ; do TTL=`redis-cli expire "$LINE" 60`; echo "$LINE"; done;
|
34
|
+
```
|
35
|
+
Please note that `keys` can be dangerous to run on a large, busy Redis. Caveat runner.
|
7
36
|
- Freeze all string literals with Ruby 2.3. [#2741]
|
8
37
|
- Client middleware can now stop bulk job push. [#2887]
|
9
38
|
|
data/Ent-Changes.md
CHANGED
@@ -3,11 +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
|
-
|
6
|
+
1.2.2
|
7
7
|
-------------
|
8
8
|
|
9
9
|
- Add API to check if a unique lock is present. See [#2932] for details.
|
10
10
|
- Tune concurrent limiters to minimize thread thrashing under heavy contention. [#2944]
|
11
|
+
- Add option for tuning which Bundler groups get preloaded with `sidekiqswarm` [#3025]
|
12
|
+
```
|
13
|
+
SIDEKIQ_PRELOAD=default,production bin/sidekiqswarm ...
|
14
|
+
# Use an empty value for maximum application compatibility
|
15
|
+
SIDEKIQ_PRELOAD= bin/sidekiqswarm ...
|
16
|
+
```
|
11
17
|
|
12
18
|
1.2.1
|
13
19
|
-------------
|
data/Pro-Changes.md
CHANGED
@@ -3,6 +3,26 @@ 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
|
+
3.3.1
|
7
|
+
---------
|
8
|
+
|
9
|
+
- If environment is unset, treat it as development so reliable\_fetch works as before 3.2.2.
|
10
|
+
|
11
|
+
3.3.0
|
12
|
+
---------
|
13
|
+
|
14
|
+
- Don't delete batches immediately upon success but set a 24 hr expiry, this allows
|
15
|
+
Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
|
16
|
+
- New `Sidekiq::PendingSet#destroy(jid)` API to remove poison pill jobs [#3015]
|
17
|
+
|
18
|
+
3.2.2
|
19
|
+
---------
|
20
|
+
|
21
|
+
- A default value for -i is only set in development now, staging or
|
22
|
+
other environments must set an index if you wish to use reliable\_fetch. [#2971]
|
23
|
+
- Fix nil dereference when checking for jobs over timeout in timed\_fetch
|
24
|
+
|
25
|
+
|
6
26
|
3.2.1
|
7
27
|
---------
|
8
28
|
|
data/lib/sidekiq/client.rb
CHANGED
@@ -84,6 +84,7 @@ module Sidekiq
|
|
84
84
|
# than the number given if the middleware stopped processing for one or more jobs.
|
85
85
|
def push_bulk(items)
|
86
86
|
arg = items['args'].first
|
87
|
+
return [] unless arg # no jobs to push
|
87
88
|
raise ArgumentError, "Bulk arguments must be an Array of Arrays: [[1], [2]]" if !arg.is_a?(Array)
|
88
89
|
|
89
90
|
normed = normalize_item(items)
|
data/lib/sidekiq/launcher.rb
CHANGED
@@ -80,7 +80,7 @@ module Sidekiq
|
|
80
80
|
workers_key = "#{key}:workers".freeze
|
81
81
|
nowdate = Time.now.utc.strftime("%Y-%m-%d".freeze)
|
82
82
|
Sidekiq.redis do |conn|
|
83
|
-
conn.
|
83
|
+
conn.multi do
|
84
84
|
conn.incrby("stat:processed".freeze, procd)
|
85
85
|
conn.incrby("stat:processed:#{nowdate}", procd)
|
86
86
|
conn.incrby("stat:failed".freeze, fails)
|
@@ -95,7 +95,7 @@ module Sidekiq
|
|
95
95
|
fails = procd = 0
|
96
96
|
|
97
97
|
_, _, _, msg = Sidekiq.redis do |conn|
|
98
|
-
conn.
|
98
|
+
conn.multi do
|
99
99
|
conn.sadd('processes', key)
|
100
100
|
conn.hmset(key, 'info', json, 'busy', Processor::WORKER_STATE.size, 'beat', Time.now.to_f, 'quiet', @done)
|
101
101
|
conn.expire(key, 60)
|
@@ -8,6 +8,8 @@ module Sidekiq
|
|
8
8
|
class << self
|
9
9
|
|
10
10
|
def create(options={})
|
11
|
+
options = options.symbolize_keys
|
12
|
+
|
11
13
|
options[:url] ||= determine_redis_provider
|
12
14
|
|
13
15
|
size = options[:size] || (Sidekiq.server? ? (Sidekiq.options[:concurrency] + 5) : 5)
|
@@ -33,7 +35,7 @@ module Sidekiq
|
|
33
35
|
# - enterprise's leader election
|
34
36
|
# - enterprise's cron support
|
35
37
|
def verify_sizing(size, concurrency)
|
36
|
-
raise ArgumentError, "Your Redis connection pool is too small for Sidekiq to work
|
38
|
+
raise ArgumentError, "Your Redis connection pool is too small for Sidekiq to work. Your pool has #{size} connections but really needs to have at least #{concurrency + 2}" if size <= concurrency
|
37
39
|
end
|
38
40
|
|
39
41
|
def build_client(options)
|
@@ -45,8 +47,8 @@ module Sidekiq
|
|
45
47
|
require 'redis/namespace'
|
46
48
|
Redis::Namespace.new(namespace, :redis => client)
|
47
49
|
rescue LoadError
|
48
|
-
Sidekiq.logger.error("Your Redis configuration
|
49
|
-
"Add the gem to your Gemfile
|
50
|
+
Sidekiq.logger.error("Your Redis configuration uses the namespace '#{namespace}' but the redis-namespace gem is not included in the Gemfile." \
|
51
|
+
"Add the gem to your Gemfile to continue using a namespace. Otherwise, remove the namespace parameter.")
|
50
52
|
exit(-127)
|
51
53
|
end
|
52
54
|
else
|
data/lib/sidekiq/version.rb
CHANGED
data/sidekiq.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.add_dependency 'redis', '~> 3.2', '>= 3.2.1'
|
19
19
|
gem.add_dependency 'connection_pool', '~> 2.2', '>= 2.2.0'
|
20
20
|
gem.add_dependency 'concurrent-ruby', '~> 1.0'
|
21
|
+
gem.add_dependency 'sinatra', '~> 1.4', '>= 1.4.6'
|
21
22
|
gem.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
|
22
|
-
gem.add_development_dependency 'sinatra', '~> 1.4', '>= 1.4.6'
|
23
23
|
gem.add_development_dependency 'minitest', '~> 5.7', '>= 5.7.0'
|
24
24
|
gem.add_development_dependency 'rake', '~> 10.0'
|
25
25
|
gem.add_development_dependency 'rails', '~> 4', '>= 3.2.0'
|
data/test/test_client.rb
CHANGED
@@ -126,6 +126,10 @@ class TestClient < Sidekiq::Test
|
|
126
126
|
assert_match(/[0-9a-f]{12}/, jid)
|
127
127
|
end
|
128
128
|
end
|
129
|
+
it 'handles no jobs' do
|
130
|
+
result = Sidekiq::Client.push_bulk('class' => 'QueuedWorker', 'args' => [])
|
131
|
+
assert_equal 0, result.size
|
132
|
+
end
|
129
133
|
end
|
130
134
|
|
131
135
|
class BaseWorker
|
@@ -27,11 +27,16 @@ class TestRedisConnection < Sidekiq::Test
|
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "namespace" do
|
30
|
-
it "uses a given :namespace" do
|
30
|
+
it "uses a given :namespace set by a symbol key" do
|
31
31
|
pool = Sidekiq::RedisConnection.create(:namespace => "xxx")
|
32
32
|
assert_equal "xxx", pool.checkout.namespace
|
33
33
|
end
|
34
34
|
|
35
|
+
it "uses a given :namespace set by a string key" do
|
36
|
+
pool = Sidekiq::RedisConnection.create("namespace" => "xxx")
|
37
|
+
assert_equal "xxx", pool.checkout.namespace
|
38
|
+
end
|
39
|
+
|
35
40
|
it "uses given :namespace over :namespace from Sidekiq.options" do
|
36
41
|
Sidekiq.options[:namespace] = "xxx"
|
37
42
|
pool = Sidekiq::RedisConnection.create(:namespace => "yyy")
|
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.1.
|
4
|
+
version: 4.1.3
|
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
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -65,45 +65,45 @@ dependencies:
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '1.0'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
68
|
+
name: sinatra
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '1.
|
73
|
+
version: '1.4'
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.
|
77
|
-
type: :
|
76
|
+
version: 1.4.6
|
77
|
+
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '1.
|
83
|
+
version: '1.4'
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 1.
|
86
|
+
version: 1.4.6
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
|
-
name:
|
88
|
+
name: redis-namespace
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '1.
|
93
|
+
version: '1.5'
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.5.2
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.5'
|
104
104
|
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: 1.
|
106
|
+
version: 1.5.2
|
107
107
|
- !ruby/object:Gem::Dependency
|
108
108
|
name: minitest
|
109
109
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,6 +168,7 @@ extensions: []
|
|
168
168
|
extra_rdoc_files: []
|
169
169
|
files:
|
170
170
|
- ".github/contributing.md"
|
171
|
+
- ".github/issue_template.md"
|
171
172
|
- ".gitignore"
|
172
173
|
- ".travis.yml"
|
173
174
|
- 3.0-Upgrade.md
|
@@ -289,8 +290,8 @@ files:
|
|
289
290
|
- web/assets/javascripts/locales/jquery.timeago.ko.js
|
290
291
|
- web/assets/javascripts/locales/jquery.timeago.lt.js
|
291
292
|
- web/assets/javascripts/locales/jquery.timeago.mk.js
|
293
|
+
- web/assets/javascripts/locales/jquery.timeago.nb.js
|
292
294
|
- web/assets/javascripts/locales/jquery.timeago.nl.js
|
293
|
-
- web/assets/javascripts/locales/jquery.timeago.no.js
|
294
295
|
- web/assets/javascripts/locales/jquery.timeago.pl.js
|
295
296
|
- web/assets/javascripts/locales/jquery.timeago.pt-br.js
|
296
297
|
- web/assets/javascripts/locales/jquery.timeago.pt.js
|