sidekiq 6.1.1 → 6.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes.md +250 -3
- data/LICENSE +3 -3
- data/README.md +10 -6
- data/bin/sidekiq +3 -3
- data/bin/sidekiqload +70 -66
- data/bin/sidekiqmon +1 -1
- data/lib/generators/sidekiq/job_generator.rb +57 -0
- data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
- data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
- data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
- data/lib/sidekiq/api.rb +352 -156
- data/lib/sidekiq/cli.rb +86 -41
- data/lib/sidekiq/client.rb +49 -73
- data/lib/sidekiq/{util.rb → component.rb} +12 -14
- data/lib/sidekiq/delay.rb +3 -1
- data/lib/sidekiq/extensions/action_mailer.rb +3 -2
- data/lib/sidekiq/extensions/active_record.rb +1 -1
- data/lib/sidekiq/extensions/generic_proxy.rb +4 -2
- data/lib/sidekiq/fetch.rb +31 -20
- data/lib/sidekiq/job.rb +13 -0
- data/lib/sidekiq/job_logger.rb +16 -28
- data/lib/sidekiq/job_retry.rb +79 -59
- data/lib/sidekiq/job_util.rb +71 -0
- data/lib/sidekiq/launcher.rb +126 -65
- data/lib/sidekiq/logger.rb +11 -20
- data/lib/sidekiq/manager.rb +35 -34
- data/lib/sidekiq/metrics/deploy.rb +47 -0
- data/lib/sidekiq/metrics/query.rb +153 -0
- data/lib/sidekiq/metrics/shared.rb +94 -0
- data/lib/sidekiq/metrics/tracking.rb +134 -0
- data/lib/sidekiq/middleware/chain.rb +88 -42
- data/lib/sidekiq/middleware/current_attributes.rb +63 -0
- data/lib/sidekiq/middleware/i18n.rb +6 -4
- data/lib/sidekiq/middleware/modules.rb +21 -0
- data/lib/sidekiq/monitor.rb +2 -2
- data/lib/sidekiq/paginator.rb +17 -9
- data/lib/sidekiq/processor.rb +47 -41
- data/lib/sidekiq/rails.rb +32 -4
- data/lib/sidekiq/redis_client_adapter.rb +154 -0
- data/lib/sidekiq/redis_connection.rb +84 -55
- data/lib/sidekiq/ring_buffer.rb +29 -0
- data/lib/sidekiq/scheduled.rb +96 -32
- data/lib/sidekiq/testing/inline.rb +4 -4
- data/lib/sidekiq/testing.rb +38 -39
- data/lib/sidekiq/transaction_aware_client.rb +45 -0
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/action.rb +3 -3
- data/lib/sidekiq/web/application.rb +41 -16
- data/lib/sidekiq/web/csrf_protection.rb +32 -5
- data/lib/sidekiq/web/helpers.rb +52 -30
- data/lib/sidekiq/web/router.rb +4 -1
- data/lib/sidekiq/web.rb +38 -78
- data/lib/sidekiq/worker.rb +142 -16
- data/lib/sidekiq.rb +114 -31
- data/sidekiq.gemspec +12 -4
- data/web/assets/images/apple-touch-icon.png +0 -0
- data/web/assets/javascripts/application.js +114 -60
- data/web/assets/javascripts/chart.min.js +13 -0
- data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
- data/web/assets/javascripts/dashboard.js +50 -67
- data/web/assets/javascripts/graph.js +16 -0
- data/web/assets/javascripts/metrics.js +262 -0
- data/web/assets/stylesheets/application-dark.css +61 -51
- data/web/assets/stylesheets/application-rtl.css +0 -4
- data/web/assets/stylesheets/application.css +84 -243
- data/web/locales/ar.yml +8 -2
- data/web/locales/el.yml +43 -19
- data/web/locales/en.yml +11 -1
- data/web/locales/es.yml +18 -2
- data/web/locales/fr.yml +8 -1
- data/web/locales/ja.yml +10 -0
- data/web/locales/lt.yml +1 -1
- data/web/locales/pt-br.yml +27 -9
- data/web/locales/ru.yml +4 -0
- data/web/locales/zh-cn.yml +36 -11
- data/web/locales/zh-tw.yml +32 -7
- data/web/views/_footer.erb +1 -1
- data/web/views/_job_info.erb +1 -1
- data/web/views/_nav.erb +1 -1
- data/web/views/_poll_link.erb +2 -5
- data/web/views/_summary.erb +7 -7
- data/web/views/busy.erb +57 -21
- data/web/views/dashboard.erb +23 -14
- data/web/views/dead.erb +1 -1
- data/web/views/layout.erb +2 -1
- data/web/views/metrics.erb +69 -0
- data/web/views/metrics_for_job.erb +87 -0
- data/web/views/morgue.erb +6 -6
- data/web/views/queue.erb +15 -11
- data/web/views/queues.erb +4 -4
- data/web/views/retries.erb +7 -7
- data/web/views/retry.erb +1 -1
- data/web/views/scheduled.erb +1 -1
- metadata +52 -39
- data/.circleci/config.yml +0 -71
- data/.github/contributing.md +0 -32
- data/.github/issue_template.md +0 -11
- data/.gitignore +0 -13
- data/.standard.yml +0 -20
- data/3.0-Upgrade.md +0 -70
- data/4.0-Upgrade.md +0 -53
- data/5.0-Upgrade.md +0 -56
- data/6.0-Upgrade.md +0 -72
- data/COMM-LICENSE +0 -97
- data/Ent-2.0-Upgrade.md +0 -37
- data/Ent-Changes.md +0 -275
- data/Gemfile +0 -24
- data/Gemfile.lock +0 -208
- data/Pro-2.0-Upgrade.md +0 -138
- data/Pro-3.0-Upgrade.md +0 -44
- data/Pro-4.0-Upgrade.md +0 -35
- data/Pro-5.0-Upgrade.md +0 -25
- data/Pro-Changes.md +0 -795
- data/Rakefile +0 -10
- data/code_of_conduct.md +0 -50
- data/lib/generators/sidekiq/worker_generator.rb +0 -57
- data/lib/sidekiq/exception_handler.rb +0 -27
metadata
CHANGED
@@ -1,43 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "<"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
22
|
+
version: 4.5.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "<"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
32
|
+
version: 4.5.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: connection_pool
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
37
|
+
- - "<"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '3'
|
31
40
|
- - ">="
|
32
41
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.2.
|
42
|
+
version: 2.2.5
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
47
|
+
- - "<"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '3'
|
38
50
|
- - ">="
|
39
51
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.2.
|
52
|
+
version: 2.2.5
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rack
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,66 +73,55 @@ executables:
|
|
61
73
|
extensions: []
|
62
74
|
extra_rdoc_files: []
|
63
75
|
files:
|
64
|
-
- ".circleci/config.yml"
|
65
|
-
- ".github/contributing.md"
|
66
|
-
- ".github/issue_template.md"
|
67
|
-
- ".gitignore"
|
68
|
-
- ".standard.yml"
|
69
|
-
- 3.0-Upgrade.md
|
70
|
-
- 4.0-Upgrade.md
|
71
|
-
- 5.0-Upgrade.md
|
72
|
-
- 6.0-Upgrade.md
|
73
|
-
- COMM-LICENSE
|
74
76
|
- Changes.md
|
75
|
-
- Ent-2.0-Upgrade.md
|
76
|
-
- Ent-Changes.md
|
77
|
-
- Gemfile
|
78
|
-
- Gemfile.lock
|
79
77
|
- LICENSE
|
80
|
-
- Pro-2.0-Upgrade.md
|
81
|
-
- Pro-3.0-Upgrade.md
|
82
|
-
- Pro-4.0-Upgrade.md
|
83
|
-
- Pro-5.0-Upgrade.md
|
84
|
-
- Pro-Changes.md
|
85
78
|
- README.md
|
86
|
-
- Rakefile
|
87
79
|
- bin/sidekiq
|
88
80
|
- bin/sidekiqload
|
89
81
|
- bin/sidekiqmon
|
90
|
-
-
|
91
|
-
- lib/generators/sidekiq/templates/
|
92
|
-
- lib/generators/sidekiq/templates/
|
93
|
-
- lib/generators/sidekiq/templates/
|
94
|
-
- lib/generators/sidekiq/worker_generator.rb
|
82
|
+
- lib/generators/sidekiq/job_generator.rb
|
83
|
+
- lib/generators/sidekiq/templates/job.rb.erb
|
84
|
+
- lib/generators/sidekiq/templates/job_spec.rb.erb
|
85
|
+
- lib/generators/sidekiq/templates/job_test.rb.erb
|
95
86
|
- lib/sidekiq.rb
|
96
87
|
- lib/sidekiq/api.rb
|
97
88
|
- lib/sidekiq/cli.rb
|
98
89
|
- lib/sidekiq/client.rb
|
90
|
+
- lib/sidekiq/component.rb
|
99
91
|
- lib/sidekiq/delay.rb
|
100
|
-
- lib/sidekiq/exception_handler.rb
|
101
92
|
- lib/sidekiq/extensions/action_mailer.rb
|
102
93
|
- lib/sidekiq/extensions/active_record.rb
|
103
94
|
- lib/sidekiq/extensions/class_methods.rb
|
104
95
|
- lib/sidekiq/extensions/generic_proxy.rb
|
105
96
|
- lib/sidekiq/fetch.rb
|
97
|
+
- lib/sidekiq/job.rb
|
106
98
|
- lib/sidekiq/job_logger.rb
|
107
99
|
- lib/sidekiq/job_retry.rb
|
100
|
+
- lib/sidekiq/job_util.rb
|
108
101
|
- lib/sidekiq/launcher.rb
|
109
102
|
- lib/sidekiq/logger.rb
|
110
103
|
- lib/sidekiq/manager.rb
|
104
|
+
- lib/sidekiq/metrics/deploy.rb
|
105
|
+
- lib/sidekiq/metrics/query.rb
|
106
|
+
- lib/sidekiq/metrics/shared.rb
|
107
|
+
- lib/sidekiq/metrics/tracking.rb
|
111
108
|
- lib/sidekiq/middleware/chain.rb
|
109
|
+
- lib/sidekiq/middleware/current_attributes.rb
|
112
110
|
- lib/sidekiq/middleware/i18n.rb
|
111
|
+
- lib/sidekiq/middleware/modules.rb
|
113
112
|
- lib/sidekiq/monitor.rb
|
114
113
|
- lib/sidekiq/paginator.rb
|
115
114
|
- lib/sidekiq/processor.rb
|
116
115
|
- lib/sidekiq/rails.rb
|
116
|
+
- lib/sidekiq/redis_client_adapter.rb
|
117
117
|
- lib/sidekiq/redis_connection.rb
|
118
|
+
- lib/sidekiq/ring_buffer.rb
|
118
119
|
- lib/sidekiq/scheduled.rb
|
119
120
|
- lib/sidekiq/sd_notify.rb
|
120
121
|
- lib/sidekiq/systemd.rb
|
121
122
|
- lib/sidekiq/testing.rb
|
122
123
|
- lib/sidekiq/testing/inline.rb
|
123
|
-
- lib/sidekiq/
|
124
|
+
- lib/sidekiq/transaction_aware_client.rb
|
124
125
|
- lib/sidekiq/version.rb
|
125
126
|
- lib/sidekiq/web.rb
|
126
127
|
- lib/sidekiq/web/action.rb
|
@@ -130,11 +131,16 @@ files:
|
|
130
131
|
- lib/sidekiq/web/router.rb
|
131
132
|
- lib/sidekiq/worker.rb
|
132
133
|
- sidekiq.gemspec
|
134
|
+
- web/assets/images/apple-touch-icon.png
|
133
135
|
- web/assets/images/favicon.ico
|
134
136
|
- web/assets/images/logo.png
|
135
137
|
- web/assets/images/status.png
|
136
138
|
- web/assets/javascripts/application.js
|
139
|
+
- web/assets/javascripts/chart.min.js
|
140
|
+
- web/assets/javascripts/chartjs-plugin-annotation.min.js
|
137
141
|
- web/assets/javascripts/dashboard.js
|
142
|
+
- web/assets/javascripts/graph.js
|
143
|
+
- web/assets/javascripts/metrics.js
|
138
144
|
- web/assets/stylesheets/application-dark.css
|
139
145
|
- web/assets/stylesheets/application-rtl.css
|
140
146
|
- web/assets/stylesheets/application.css
|
@@ -179,6 +185,8 @@ files:
|
|
179
185
|
- web/views/dashboard.erb
|
180
186
|
- web/views/dead.erb
|
181
187
|
- web/views/layout.erb
|
188
|
+
- web/views/metrics.erb
|
189
|
+
- web/views/metrics_for_job.erb
|
182
190
|
- web/views/morgue.erb
|
183
191
|
- web/views/queue.erb
|
184
192
|
- web/views/queues.erb
|
@@ -186,11 +194,16 @@ files:
|
|
186
194
|
- web/views/retry.erb
|
187
195
|
- web/views/scheduled.erb
|
188
196
|
- web/views/scheduled_job_info.erb
|
189
|
-
homepage:
|
197
|
+
homepage: https://sidekiq.org
|
190
198
|
licenses:
|
191
199
|
- LGPL-3.0
|
192
|
-
metadata:
|
193
|
-
|
200
|
+
metadata:
|
201
|
+
homepage_uri: https://sidekiq.org
|
202
|
+
bug_tracker_uri: https://github.com/mperham/sidekiq/issues
|
203
|
+
documentation_uri: https://github.com/mperham/sidekiq/wiki
|
204
|
+
changelog_uri: https://github.com/mperham/sidekiq/blob/main/Changes.md
|
205
|
+
source_code_uri: https://github.com/mperham/sidekiq
|
206
|
+
post_install_message:
|
194
207
|
rdoc_options: []
|
195
208
|
require_paths:
|
196
209
|
- lib
|
@@ -205,8 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
218
|
- !ruby/object:Gem::Version
|
206
219
|
version: '0'
|
207
220
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
209
|
-
signing_key:
|
221
|
+
rubygems_version: 3.4.7
|
222
|
+
signing_key:
|
210
223
|
specification_version: 4
|
211
224
|
summary: Simple, efficient background processing for Ruby
|
212
225
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
references:
|
3
|
-
unit: &unit
|
4
|
-
run:
|
5
|
-
name: Run test suite
|
6
|
-
command: bundle exec rake COVERAGE=1
|
7
|
-
restore: &restore
|
8
|
-
restore_cache:
|
9
|
-
keys:
|
10
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
11
|
-
# fallback to using the latest cache if no exact match is found
|
12
|
-
- v1-dependencies-
|
13
|
-
bundle: &bundle
|
14
|
-
run:
|
15
|
-
name: install dependencies
|
16
|
-
command: |
|
17
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
18
|
-
save: &save
|
19
|
-
save_cache:
|
20
|
-
paths:
|
21
|
-
- ./vendor/bundle
|
22
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
23
|
-
jobs:
|
24
|
-
"ruby-2.5":
|
25
|
-
docker:
|
26
|
-
- image: circleci/ruby:2.5
|
27
|
-
- image: circleci/redis:4.0
|
28
|
-
steps:
|
29
|
-
- checkout
|
30
|
-
- <<: *restore
|
31
|
-
- <<: *bundle
|
32
|
-
- <<: *save
|
33
|
-
- <<: *unit
|
34
|
-
"ruby-2.6":
|
35
|
-
docker:
|
36
|
-
- image: circleci/ruby:2.6
|
37
|
-
- image: circleci/redis:5.0
|
38
|
-
steps:
|
39
|
-
- checkout
|
40
|
-
- <<: *restore
|
41
|
-
- <<: *bundle
|
42
|
-
- <<: *save
|
43
|
-
- <<: *unit
|
44
|
-
"ruby-2.7":
|
45
|
-
docker:
|
46
|
-
- image: circleci/ruby:2.7
|
47
|
-
- image: circleci/redis:6.0
|
48
|
-
steps:
|
49
|
-
- checkout
|
50
|
-
- <<: *restore
|
51
|
-
- <<: *bundle
|
52
|
-
- <<: *save
|
53
|
-
- <<: *unit
|
54
|
-
"jruby":
|
55
|
-
docker:
|
56
|
-
- image: circleci/jruby:latest
|
57
|
-
- image: circleci/redis:4.0
|
58
|
-
steps:
|
59
|
-
- checkout
|
60
|
-
- <<: *restore
|
61
|
-
- <<: *bundle
|
62
|
-
- <<: *save
|
63
|
-
- <<: *unit
|
64
|
-
|
65
|
-
workflows:
|
66
|
-
version: 2
|
67
|
-
build:
|
68
|
-
jobs:
|
69
|
-
- "ruby-2.5"
|
70
|
-
- "ruby-2.6"
|
71
|
-
- "ruby-2.7"
|
data/.github/contributing.md
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
## Issues
|
4
|
-
|
5
|
-
When opening an issue:
|
6
|
-
|
7
|
-
* include the full **backtrace** with your error
|
8
|
-
* include your Sidekiq initializer
|
9
|
-
* list versions you are using: Ruby, Rails, Sidekiq, OS, etc.
|
10
|
-
|
11
|
-
It's always better to include more info rather than less.
|
12
|
-
|
13
|
-
## Code
|
14
|
-
|
15
|
-
It's always best to open an issue before investing a lot of time into a
|
16
|
-
fix or new functionality. Functionality must meet my design goals and
|
17
|
-
vision for the project to be accepted; I would be happy to discuss how
|
18
|
-
your idea can best fit into Sidekiq.
|
19
|
-
|
20
|
-
## Legal
|
21
|
-
|
22
|
-
By submitting a Pull Request, you disavow any rights or claims to any changes
|
23
|
-
submitted to the Sidekiq project and assign the copyright of
|
24
|
-
those changes to Contributed Systems LLC.
|
25
|
-
|
26
|
-
If you cannot or do not want to reassign those rights (your employment
|
27
|
-
contract for your employer may not allow this), you should not submit a PR.
|
28
|
-
Open an issue and someone else can do the work.
|
29
|
-
|
30
|
-
This is a legal way of saying "If you submit a PR to us, that code becomes ours".
|
31
|
-
99.9% of the time that's what you intend anyways; we hope it doesn't scare you
|
32
|
-
away from contributing.
|
data/.github/issue_template.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Ruby version:
|
2
|
-
Sidekiq / Pro / Enterprise version(s):
|
3
|
-
|
4
|
-
Please include your initializer and any error message with the full backtrace.
|
5
|
-
|
6
|
-
Are you using an old version?
|
7
|
-
Have you checked the changelogs to see if your issue has been fixed in a later version?
|
8
|
-
|
9
|
-
https://github.com/mperham/sidekiq/blob/master/Changes.md
|
10
|
-
https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md
|
11
|
-
https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md
|
data/.gitignore
DELETED
data/.standard.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
ruby_version: 2.5.0
|
2
|
-
fix: false
|
3
|
-
parallel: true
|
4
|
-
ignore:
|
5
|
-
- test/**/*
|
6
|
-
- examples/**/*
|
7
|
-
- myapp/**/*
|
8
|
-
- 'lib/sidekiq.rb':
|
9
|
-
- Lint/InheritException
|
10
|
-
- 'lib/sidekiq/extensions/**/*':
|
11
|
-
- Style/MethodMissingSuper
|
12
|
-
- Style/MissingRespondToMissing
|
13
|
-
- 'lib/**/*':
|
14
|
-
- Naming/AsciiIdentifiers
|
15
|
-
- Lint/RescueException
|
16
|
-
- Security/YAMLLoad
|
17
|
-
- Naming/AccessorMethodName
|
18
|
-
- Naming/MethodName
|
19
|
-
- Style/GlobalVars
|
20
|
-
- Style/Alias
|
data/3.0-Upgrade.md
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
# Upgrading to Sidekiq 3.0
|
2
|
-
|
3
|
-
Sidekiq 3.0 brings several new features but also removes old APIs and
|
4
|
-
changes a few data elements in Redis. To upgrade cleanly:
|
5
|
-
|
6
|
-
* Upgrade to the latest Sidekiq 2.x and run it for a few weeks.
|
7
|
-
`gem 'sidekiq', '< 3'`
|
8
|
-
This is only needed if you have retries pending.
|
9
|
-
* 3rd party gems which use **client-side middleware** will need to update
|
10
|
-
due to an API change. The Redis connection for a particular job is
|
11
|
-
passed thru the middleware to handle sharding where jobs can
|
12
|
-
be pushed to different redis server instances.
|
13
|
-
|
14
|
-
`def call(worker_class, msg, queue, redis_pool)`
|
15
|
-
|
16
|
-
Client-side middleware should use `redis_pool.with { |conn| ... }` to
|
17
|
-
perform Redis operations and **not** `Sidekiq.redis`.
|
18
|
-
* If you used the capistrano integration, you'll need to pull in the
|
19
|
-
new [capistrano-sidekiq](https://github.com/seuros/capistrano-sidekiq)
|
20
|
-
gem and use it in your deploy.rb.
|
21
|
-
* API changes:
|
22
|
-
- `Sidekiq::Client.registered_workers` replaced by `Sidekiq::Workers.new`
|
23
|
-
- `Sidekiq::Client.registered_queues` replaced by `Sidekiq::Queue.all`
|
24
|
-
- `Sidekiq::Worker#retries_exhausted` replaced by `Sidekiq::Worker.sidekiq_retries_exhausted`
|
25
|
-
- `Sidekiq::Workers#each` has changed significantly with a reworking
|
26
|
-
of Sidekiq's internal process/thread data model.
|
27
|
-
* `sidekiq/api` is no longer automatically required. If your code uses
|
28
|
-
the API, you will need to require it.
|
29
|
-
* Redis-to-Go is no longer transparently activated on Heroku so as to not play
|
30
|
-
favorites with any particular Redis service. You need to set a config option
|
31
|
-
for your app:
|
32
|
-
`heroku config:set REDIS_PROVIDER=REDISTOGO_URL`. You may also use
|
33
|
-
the generic `REDIS_URL`. See
|
34
|
-
[Advanced Options: Setting the Location of your Redis server][1]
|
35
|
-
for details.
|
36
|
-
* Anyone using Airbrake, Honeybadger, Exceptional or ExceptionNotifier
|
37
|
-
will need to update their error gem version to the latest to pull in
|
38
|
-
Sidekiq support. Sidekiq will not provide explicit support for these
|
39
|
-
services so as to not play favorites with any particular error service.
|
40
|
-
* MRI 1.9 is no longer officially supported. Sidekiq's official
|
41
|
-
support policy is to support the current and previous major releases
|
42
|
-
of MRI and Rails. As of February 2014, that's MRI 2.1, MRI 2.0, JRuby 1.7, Rails 4.0
|
43
|
-
and Rails 3.2. I will consider PRs to fix issues found by users for
|
44
|
-
other platforms/versions.
|
45
|
-
|
46
|
-
## Error Service Providers
|
47
|
-
|
48
|
-
If you previously provided a middleware to capture job errors, you
|
49
|
-
should instead provide a global error handler with Sidekiq 3.0. This
|
50
|
-
ensures **any** error within Sidekiq will be logged appropriately, not
|
51
|
-
just during job execution.
|
52
|
-
|
53
|
-
```ruby
|
54
|
-
if Sidekiq::VERSION < '3'
|
55
|
-
# old behavior
|
56
|
-
Sidekiq.configure_server do |config|
|
57
|
-
config.server_middleware do |chain|
|
58
|
-
chain.add MyErrorService::Middleware
|
59
|
-
end
|
60
|
-
end
|
61
|
-
else
|
62
|
-
Sidekiq.configure_server do |config|
|
63
|
-
config.error_handlers << proc {|ex,context| MyErrorService.notify(ex, context) }
|
64
|
-
end
|
65
|
-
end
|
66
|
-
```
|
67
|
-
|
68
|
-
Your error handler must respond to `call(exception, context_hash)`.
|
69
|
-
|
70
|
-
[1]: https://github.com/mperham/sidekiq/wiki/Advanced-Options#via-env-variable
|
data/4.0-Upgrade.md
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# Welcome to Sidekiq 4.0!
|
2
|
-
|
3
|
-
Sidekiq 4.0 contains a redesigned, more efficient core with less overhead per job.
|
4
|
-
See my blog for [an overview of Sidekiq 4's higher performance](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
|
5
|
-
|
6
|
-
## What's New
|
7
|
-
|
8
|
-
* Sidekiq no longer uses Celluloid. If your application code uses Celluloid,
|
9
|
-
you will need to pull it in yourself.
|
10
|
-
|
11
|
-
* `redis-namespace` has been removed from Sidekiq's gem dependencies. If
|
12
|
-
you want to use namespacing ([and I strongly urge you not to](http://www.mikeperham.com/2015/09/24/storing-data-with-redis/)), you'll need to add the gem to your Gemfile:
|
13
|
-
```ruby
|
14
|
-
gem 'redis-namespace'
|
15
|
-
```
|
16
|
-
|
17
|
-
* **Redis 2.8.0 or greater is required.** Redis 2.8 was released two years
|
18
|
-
ago and contains **many** useful features which Sidekiq couldn't
|
19
|
-
leverage until now. **Redis 3.0.3 or greater is recommended** for large
|
20
|
-
scale use [#2431](https://github.com/mperham/sidekiq/issues/2431).
|
21
|
-
|
22
|
-
* Jobs are now fetched from Redis in parallel, making Sidekiq more
|
23
|
-
resilient to high network latency. This means that Sidekiq requires
|
24
|
-
more Redis connections per process. You must have a minimum of
|
25
|
-
`concurrency + 2` connections in your pool or Sidekiq will exit.
|
26
|
-
When in doubt, let Sidekiq size the connection pool for you.
|
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
|
-
|
31
|
-
* There's a new testing API based off the `Sidekiq::Queues` namespace. All
|
32
|
-
assertions made against the Worker class still work as expected.
|
33
|
-
```ruby
|
34
|
-
assert_equal 0, Sidekiq::Queues["default"].size
|
35
|
-
HardWorker.perform_async("log")
|
36
|
-
assert_equal 1, Sidekiq::Queues["default"].size
|
37
|
-
assert_equal "log", Sidekiq::Queues["default"].first['args'][0]
|
38
|
-
Sidekiq::Queues.clear_all
|
39
|
-
```
|
40
|
-
|
41
|
-
## Upgrade
|
42
|
-
|
43
|
-
First, make sure you are using Redis 2.8 or greater. Next:
|
44
|
-
|
45
|
-
* Upgrade to the latest Sidekiq 3.x.
|
46
|
-
```ruby
|
47
|
-
gem 'sidekiq', '< 4'
|
48
|
-
```
|
49
|
-
* Fix any deprecation warnings you see.
|
50
|
-
* Upgrade to 4.x.
|
51
|
-
```ruby
|
52
|
-
gem 'sidekiq', '< 5'
|
53
|
-
```
|
data/5.0-Upgrade.md
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# Welcome to Sidekiq 5.0!
|
2
|
-
|
3
|
-
Sidekiq 5.0 contains a reworked job dispatch and execution core to integrate
|
4
|
-
better with the new Rails 5.0 Executor. It also drops support for older
|
5
|
-
versions of Ruby and Rails and adds support for RTL languages in the Web UI.
|
6
|
-
|
7
|
-
## What's New
|
8
|
-
|
9
|
-
* Integrate job logging and retry logic directly in with the job
|
10
|
-
execution logic in Sidekiq::Processor. Previously this logic was
|
11
|
-
defined as middleware. In Rails 5.0, ActiveSupport::Executor handles ActiveRecord
|
12
|
-
connection management, job callbacks, development mode class loading,
|
13
|
-
etc. Because of its extensive responsibilities, the Executor can't be
|
14
|
-
integrated as Sidekiq middleware; the logging/retry logic had to be pulled out
|
15
|
-
too. Sidekiq 4.2 had a hack to make it work but this redesign provides
|
16
|
-
a cleaner integration. [#3235]
|
17
|
-
* The Delayed Extensions `delay`, `delay_in` and `delay_until` APIs are
|
18
|
-
no longer available by default. The extensions allow you to marshal
|
19
|
-
job arguments as YAML, leading to cases where job payloads could be many
|
20
|
-
100s of KB or larger if not careful, leading to Redis networking
|
21
|
-
timeouts or other problems. As noted in the Best Practices wiki page,
|
22
|
-
Sidekiq is designed for jobs with small, simple arguments.
|
23
|
-
|
24
|
-
Add this line to your initializer to re-enable them and get the old behavior:
|
25
|
-
```ruby
|
26
|
-
Sidekiq::Extensions.enable_delay!
|
27
|
-
```
|
28
|
-
The old `Sidekiq.remove_delay!` API has been removed as it is now the default. [#3299]
|
29
|
-
* Sidekiq's quiet signal is now `TSTP` (think of it as **T**hread
|
30
|
-
**ST**o**P**) instead of USR1 as USR1 is not available on JRuby.
|
31
|
-
USR1 will continue to be supported in Sidekiq 5.x for backwards
|
32
|
-
compatibility and will be removed in Sidekiq 6.x. [#3302]
|
33
|
-
* The Web UI is now bi-directional - it can render either LTR
|
34
|
-
(left-to-right) or RTL languages. With this change, **Farsi, Arabic,
|
35
|
-
Hebrew and Urdu** are officially supported. [#3381]
|
36
|
-
* Jobs which can't be parsed due to invalid JSON are now pushed
|
37
|
-
immediately to the Dead set since they require manual intervention and
|
38
|
-
will never execute successfully as is. The Web UI has been updated to
|
39
|
-
more gracefully display these jobs. [#3296]
|
40
|
-
* **Rails 3.2** is no longer supported.
|
41
|
-
* **Ruby 2.0 and Ruby 2.1** are no longer supported. Ruby 2.2.2+ is required.
|
42
|
-
|
43
|
-
## Upgrade
|
44
|
-
|
45
|
-
As always, please upgrade Sidekiq **one major version at a time**.
|
46
|
-
If you are already running Sidekiq 4.x, then:
|
47
|
-
|
48
|
-
* Upgrade to the latest Sidekiq 4.x.
|
49
|
-
```ruby
|
50
|
-
gem 'sidekiq', '< 5'
|
51
|
-
```
|
52
|
-
* Fix any deprecation warnings you see.
|
53
|
-
* Upgrade to 5.x.
|
54
|
-
```ruby
|
55
|
-
gem 'sidekiq', '< 6'
|
56
|
-
```
|
data/6.0-Upgrade.md
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# Welcome to Sidekiq 6.0!
|
2
|
-
|
3
|
-
Sidekiq 6.0 contains some breaking changes which streamline proper operation
|
4
|
-
of Sidekiq. It also drops support for EOL versions of Ruby and Rails.
|
5
|
-
|
6
|
-
## What's New
|
7
|
-
|
8
|
-
This release has major breaking changes. Read and test carefully in production.
|
9
|
-
|
10
|
-
- ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
|
11
|
-
features/internals like the retry subsystem. Prefer the native
|
12
|
-
Sidekiq::Worker APIs as some Sidekiq features (e.g. unique jobs) do not work well with AJ.
|
13
|
-
(requires Rails 6.0.2)
|
14
|
-
```ruby
|
15
|
-
class MyJob < ActiveJob::Base
|
16
|
-
queue_as :myqueue
|
17
|
-
sidekiq_options retry: 10, backtrace: 20
|
18
|
-
def perform(...)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
```
|
22
|
-
- Logging has been redesigned to allow pluggable formatters and several
|
23
|
-
formats ship with Sidekiq:
|
24
|
-
* default - your typical output on macOS
|
25
|
-
* heroku - enabled specifically when running in Heroku
|
26
|
-
* json - a JSON format for search indexing, one hash per line
|
27
|
-
|
28
|
-
Sidekiq will enable the best formatter for the detected environment but
|
29
|
-
you can override it by configuring the log formatter explicitly. See
|
30
|
-
'sidekiq/logger' for implementation details.
|
31
|
-
|
32
|
-
```ruby
|
33
|
-
Sidekiq.configure_server do |config|
|
34
|
-
config.log_formatter = AcmeCorp::PlainLogFormatter.new
|
35
|
-
# config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
|
36
|
-
end
|
37
|
-
```
|
38
|
-
Please see the [Logging](https://github.com/mperham/sidekiq/wiki/Logging) wiki page for the latest documentation and notes.
|
39
|
-
- **Remove the daemonization, logfile and pidfile command line arguments and `sidekiqctl` binary**.
|
40
|
-
I've [noted for years](https://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/)
|
41
|
-
how modern services should be managed with a proper init system.
|
42
|
-
Managing services manually is more error-prone, let your operating system do it for you.
|
43
|
-
systemd, upstart, and foreman are three options. See the Deployment wiki page for the latest details.
|
44
|
-
- **Validate proper usage of the `REDIS_PROVIDER` variable.**
|
45
|
-
This variable is meant to hold the name of the environment
|
46
|
-
variable which contains your Redis URL, so that you can switch Redis
|
47
|
-
providers quickly and easily with a single variable change. It is not
|
48
|
-
meant to hold the actual Redis URL itself. If you want to manually set
|
49
|
-
the Redis URL then you may set `REDIS_URL` directly. [#3969]
|
50
|
-
- **Increase default shutdown timeout from 8 seconds to 25 seconds.**
|
51
|
-
Both Heroku and ECS now use 30 second shutdown timeout
|
52
|
-
by default and we want Sidekiq to take advantage of this time. If you
|
53
|
-
have deployment scripts which depend on the old default timeout, use `-t 8` to
|
54
|
-
get the old behavior. [#3968]
|
55
|
-
* **Rails <5** is no longer supported. Rails 6+ only works in zeitwerk mode.
|
56
|
-
* **Ruby <2.5** is no longer supported.
|
57
|
-
* **Redis <4** is no longer supported.
|
58
|
-
|
59
|
-
## Upgrade
|
60
|
-
|
61
|
-
As always, please upgrade Sidekiq **one major version at a time**.
|
62
|
-
If you are already running Sidekiq 5.x, then:
|
63
|
-
|
64
|
-
* Upgrade to the latest Sidekiq 5.x.
|
65
|
-
```ruby
|
66
|
-
gem 'sidekiq', '< 6'
|
67
|
-
```
|
68
|
-
* Fix any deprecation warnings you see.
|
69
|
-
* Upgrade to 6.x.
|
70
|
-
```ruby
|
71
|
-
gem 'sidekiq', '< 7'
|
72
|
-
```
|