sidekiq 6.1.0 → 6.2.1

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.

Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +64 -2
  3. data/README.md +1 -2
  4. data/lib/sidekiq.rb +1 -1
  5. data/lib/sidekiq/api.rb +27 -9
  6. data/lib/sidekiq/cli.rb +20 -12
  7. data/lib/sidekiq/client.rb +1 -5
  8. data/lib/sidekiq/extensions/action_mailer.rb +3 -2
  9. data/lib/sidekiq/extensions/active_record.rb +1 -1
  10. data/lib/sidekiq/fetch.rb +9 -3
  11. data/lib/sidekiq/job_retry.rb +1 -0
  12. data/lib/sidekiq/launcher.rb +58 -1
  13. data/lib/sidekiq/logger.rb +3 -2
  14. data/lib/sidekiq/manager.rb +1 -1
  15. data/lib/sidekiq/middleware/chain.rb +1 -1
  16. data/lib/sidekiq/util.rb +28 -0
  17. data/lib/sidekiq/version.rb +1 -1
  18. data/lib/sidekiq/web.rb +33 -78
  19. data/lib/sidekiq/web/action.rb +1 -1
  20. data/lib/sidekiq/web/application.rb +12 -6
  21. data/lib/sidekiq/web/csrf_protection.rb +30 -3
  22. data/lib/sidekiq/web/helpers.rb +23 -2
  23. data/lib/sidekiq/web/router.rb +4 -1
  24. data/sidekiq.gemspec +10 -2
  25. data/web/assets/images/apple-touch-icon.png +0 -0
  26. data/web/assets/javascripts/application.js +1 -6
  27. data/web/assets/stylesheets/application-dark.css +59 -32
  28. data/web/assets/stylesheets/application.css +19 -8
  29. data/web/locales/fr.yml +1 -1
  30. data/web/locales/ru.yml +4 -0
  31. data/web/views/busy.erb +47 -16
  32. data/web/views/layout.erb +1 -0
  33. data/web/views/morgue.erb +1 -1
  34. data/web/views/queue.erb +1 -1
  35. data/web/views/queues.erb +1 -1
  36. data/web/views/retries.erb +1 -1
  37. data/web/views/scheduled.erb +1 -1
  38. metadata +14 -29
  39. data/.circleci/config.yml +0 -71
  40. data/.github/contributing.md +0 -32
  41. data/.github/issue_template.md +0 -11
  42. data/.gitignore +0 -13
  43. data/.standard.yml +0 -20
  44. data/3.0-Upgrade.md +0 -70
  45. data/4.0-Upgrade.md +0 -53
  46. data/5.0-Upgrade.md +0 -56
  47. data/6.0-Upgrade.md +0 -72
  48. data/COMM-LICENSE +0 -97
  49. data/Ent-2.0-Upgrade.md +0 -37
  50. data/Ent-Changes.md +0 -269
  51. data/Gemfile +0 -24
  52. data/Gemfile.lock +0 -208
  53. data/Pro-2.0-Upgrade.md +0 -138
  54. data/Pro-3.0-Upgrade.md +0 -44
  55. data/Pro-4.0-Upgrade.md +0 -35
  56. data/Pro-5.0-Upgrade.md +0 -25
  57. data/Pro-Changes.md +0 -790
  58. data/Rakefile +0 -10
  59. data/code_of_conduct.md +0 -50
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.1.0
4
+ version: 6.2.1
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: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -61,33 +61,12 @@ executables:
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  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
64
  - Changes.md
75
- - Ent-2.0-Upgrade.md
76
- - Ent-Changes.md
77
- - Gemfile
78
- - Gemfile.lock
79
65
  - 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
66
  - README.md
86
- - Rakefile
87
67
  - bin/sidekiq
88
68
  - bin/sidekiqload
89
69
  - bin/sidekiqmon
90
- - code_of_conduct.md
91
70
  - lib/generators/sidekiq/templates/worker.rb.erb
92
71
  - lib/generators/sidekiq/templates/worker_spec.rb.erb
93
72
  - lib/generators/sidekiq/templates/worker_test.rb.erb
@@ -130,6 +109,7 @@ files:
130
109
  - lib/sidekiq/web/router.rb
131
110
  - lib/sidekiq/worker.rb
132
111
  - sidekiq.gemspec
112
+ - web/assets/images/apple-touch-icon.png
133
113
  - web/assets/images/favicon.ico
134
114
  - web/assets/images/logo.png
135
115
  - web/assets/images/status.png
@@ -186,11 +166,16 @@ files:
186
166
  - web/views/retry.erb
187
167
  - web/views/scheduled.erb
188
168
  - web/views/scheduled_job_info.erb
189
- homepage: http://sidekiq.org
169
+ homepage: https://sidekiq.org
190
170
  licenses:
191
171
  - LGPL-3.0
192
- metadata: {}
193
- post_install_message:
172
+ metadata:
173
+ homepage_uri: https://sidekiq.org
174
+ bug_tracker_uri: https://github.com/mperham/sidekiq/issues
175
+ documentation_uri: https://github.com/mperham/sidekiq/wiki
176
+ changelog_uri: https://github.com/mperham/sidekiq/blob/master/Changes.md
177
+ source_code_uri: https://github.com/mperham/sidekiq
178
+ post_install_message:
194
179
  rdoc_options: []
195
180
  require_paths:
196
181
  - lib
@@ -205,8 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
190
  - !ruby/object:Gem::Version
206
191
  version: '0'
207
192
  requirements: []
208
- rubygems_version: 3.1.2
209
- signing_key:
193
+ rubygems_version: 3.1.4
194
+ signing_key:
210
195
  specification_version: 4
211
196
  summary: Simple, efficient background processing for Ruby
212
197
  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"
@@ -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.
@@ -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
@@ -1,13 +0,0 @@
1
- .rvmrc
2
- .ruby-version
3
- tags
4
- *.swp
5
- dump.rdb
6
- .rbx
7
- coverage/
8
- vendor/
9
- .bundle/
10
- .sass-cache/
11
- tmp/
12
- pkg/*.gem
13
- .byebug_history
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
- ```