sidekiq 5.2.9 → 6.4.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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +318 -1
  3. data/LICENSE +3 -3
  4. data/README.md +23 -34
  5. data/bin/sidekiq +27 -3
  6. data/bin/sidekiqload +67 -61
  7. data/bin/sidekiqmon +8 -0
  8. data/lib/generators/sidekiq/job_generator.rb +57 -0
  9. data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
  10. data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
  11. data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
  12. data/lib/sidekiq/api.rb +335 -267
  13. data/lib/sidekiq/cli.rb +164 -182
  14. data/lib/sidekiq/client.rb +58 -61
  15. data/lib/sidekiq/delay.rb +7 -6
  16. data/lib/sidekiq/exception_handler.rb +10 -12
  17. data/lib/sidekiq/extensions/action_mailer.rb +13 -22
  18. data/lib/sidekiq/extensions/active_record.rb +13 -10
  19. data/lib/sidekiq/extensions/class_methods.rb +14 -11
  20. data/lib/sidekiq/extensions/generic_proxy.rb +6 -4
  21. data/lib/sidekiq/fetch.rb +40 -32
  22. data/lib/sidekiq/job.rb +13 -0
  23. data/lib/sidekiq/job_logger.rb +33 -7
  24. data/lib/sidekiq/job_retry.rb +70 -71
  25. data/lib/sidekiq/job_util.rb +65 -0
  26. data/lib/sidekiq/launcher.rb +161 -71
  27. data/lib/sidekiq/logger.rb +170 -0
  28. data/lib/sidekiq/manager.rb +17 -21
  29. data/lib/sidekiq/middleware/chain.rb +20 -8
  30. data/lib/sidekiq/middleware/current_attributes.rb +57 -0
  31. data/lib/sidekiq/middleware/i18n.rb +5 -7
  32. data/lib/sidekiq/monitor.rb +133 -0
  33. data/lib/sidekiq/paginator.rb +20 -16
  34. data/lib/sidekiq/processor.rb +71 -70
  35. data/lib/sidekiq/rails.rb +40 -37
  36. data/lib/sidekiq/redis_connection.rb +48 -48
  37. data/lib/sidekiq/scheduled.rb +62 -28
  38. data/lib/sidekiq/sd_notify.rb +149 -0
  39. data/lib/sidekiq/systemd.rb +24 -0
  40. data/lib/sidekiq/testing/inline.rb +2 -1
  41. data/lib/sidekiq/testing.rb +36 -27
  42. data/lib/sidekiq/util.rb +57 -15
  43. data/lib/sidekiq/version.rb +2 -1
  44. data/lib/sidekiq/web/action.rb +15 -11
  45. data/lib/sidekiq/web/application.rb +88 -75
  46. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  47. data/lib/sidekiq/web/helpers.rb +109 -92
  48. data/lib/sidekiq/web/router.rb +23 -19
  49. data/lib/sidekiq/web.rb +61 -105
  50. data/lib/sidekiq/worker.rb +247 -105
  51. data/lib/sidekiq.rb +77 -44
  52. data/sidekiq.gemspec +23 -16
  53. data/web/assets/images/apple-touch-icon.png +0 -0
  54. data/web/assets/javascripts/application.js +83 -64
  55. data/web/assets/javascripts/dashboard.js +54 -73
  56. data/web/assets/stylesheets/application-dark.css +143 -0
  57. data/web/assets/stylesheets/application-rtl.css +0 -4
  58. data/web/assets/stylesheets/application.css +45 -232
  59. data/web/locales/ar.yml +8 -2
  60. data/web/locales/de.yml +14 -2
  61. data/web/locales/en.yml +6 -1
  62. data/web/locales/es.yml +18 -2
  63. data/web/locales/fr.yml +10 -3
  64. data/web/locales/ja.yml +7 -1
  65. data/web/locales/lt.yml +83 -0
  66. data/web/locales/pl.yml +4 -4
  67. data/web/locales/ru.yml +4 -0
  68. data/web/locales/vi.yml +83 -0
  69. data/web/views/_footer.erb +1 -1
  70. data/web/views/_job_info.erb +3 -2
  71. data/web/views/_poll_link.erb +2 -5
  72. data/web/views/_summary.erb +7 -7
  73. data/web/views/busy.erb +54 -20
  74. data/web/views/dashboard.erb +22 -14
  75. data/web/views/dead.erb +3 -3
  76. data/web/views/layout.erb +3 -1
  77. data/web/views/morgue.erb +9 -6
  78. data/web/views/queue.erb +19 -10
  79. data/web/views/queues.erb +10 -2
  80. data/web/views/retries.erb +11 -8
  81. data/web/views/retry.erb +3 -3
  82. data/web/views/scheduled.erb +5 -2
  83. metadata +34 -64
  84. data/.circleci/config.yml +0 -61
  85. data/.github/contributing.md +0 -32
  86. data/.github/issue_template.md +0 -11
  87. data/.gitignore +0 -15
  88. data/.travis.yml +0 -11
  89. data/3.0-Upgrade.md +0 -70
  90. data/4.0-Upgrade.md +0 -53
  91. data/5.0-Upgrade.md +0 -56
  92. data/COMM-LICENSE +0 -97
  93. data/Ent-Changes.md +0 -238
  94. data/Gemfile +0 -23
  95. data/Pro-2.0-Upgrade.md +0 -138
  96. data/Pro-3.0-Upgrade.md +0 -44
  97. data/Pro-4.0-Upgrade.md +0 -35
  98. data/Pro-Changes.md +0 -759
  99. data/Rakefile +0 -9
  100. data/bin/sidekiqctl +0 -20
  101. data/code_of_conduct.md +0 -50
  102. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  103. data/lib/sidekiq/core_ext.rb +0 -1
  104. data/lib/sidekiq/ctl.rb +0 -221
  105. data/lib/sidekiq/logging.rb +0 -122
  106. data/lib/sidekiq/middleware/server/active_record.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 575db4e3e544aee9b13d0cd23610bf39c4167e3a9835d4c046a9b355d2cb9c0e
4
- data.tar.gz: 3f1f5806001515d03e206ce8d0695e59f9ff563ac5d84472294799424187591c
3
+ metadata.gz: 99c9e264c092b88ea726be158fafe5bbab91f82f4b5864dee406280622e98e4b
4
+ data.tar.gz: acd72bd99929d7c9d129cb9662276cc5adb7214de07cd4fc8accf6b9d521994a
5
5
  SHA512:
6
- metadata.gz: 525fe03fcc6911d231696182d46de5da5d4c072681c924b14a0732aeb6aed3a1310baa4f9827f0f50925b69bede7218d485c4a81ebeb2feb712881b39da996e7
7
- data.tar.gz: 586fb51fff5bfefaa6db779e470b6040c8d98a2d4e8fb319cde6087c3f02ffc242ae0a067e32cb8f25585cd6d8d6c12e40f05507514b9406bdb1eadb3ac6f2dd
6
+ metadata.gz: 622c25276c017302c1a9d144e9366043ba359b2c3b0c57d4e7baad8f9de2e9c9969a86c91acdbefcf736af92e297c4e1fbe2008aa41e0c1accadda77dd0724f5
7
+ data.tar.gz: 7e64012a5368cb0158ecaa50cdea6447709a64dd3a2816b36a31e7f17d70fffff81bd8d317c0cc1f9a6317adcffad9c200c48f9ca4bf208afba819ff7a07738e
data/Changes.md CHANGED
@@ -1,6 +1,323 @@
1
1
  # Sidekiq Changes
2
2
 
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)
3
+ [Sidekiq Changes](https://github.com/mperham/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/main/Ent-Changes.md)
4
+
5
+ HEAD
6
+ ---------
7
+
8
+ - Fix pipeline/multi deprecations in redis-rb 4.6
9
+ - Fix sidekiq.yml YAML load errors on Ruby 3.1 [#5141]
10
+ - Sharding support for `perform_bulk` [#5129]
11
+ - Refactor job logger for SPEEEEEEED
12
+
13
+ 6.4.0
14
+ ---------
15
+
16
+ - **SECURITY**: Validate input to avoid possible DoS in Web UI.
17
+ - Add **strict argument checking** [#5071]
18
+ Sidekiq will now log a warning if JSON-unsafe arguments are passed to `perform_async`.
19
+ Add `Sidekiq.strict_args!(false)` to your initializer to disable this warning.
20
+ This warning will switch to an exception in Sidekiq 7.0.
21
+ - Note that Delayed Extensions will be removed in Sidekiq 7.0 [#5076]
22
+ - Add `perform_{inline,sync}` in Sidekiq::Job to run a job synchronously [#5061, hasan-ally]
23
+ ```ruby
24
+ SomeJob.perform_async(args...)
25
+ SomeJob.perform_sync(args...)
26
+ SomeJob.perform_inline(args...)
27
+ ```
28
+ You can also dynamically redirect a job to run synchronously:
29
+ ```ruby
30
+ SomeJob.set("sync": true).perform_async(args...) # will run via perform_inline
31
+ ```
32
+ - Replace Sidekiq::Worker `app/workers` generator with Sidekiq::Job `app/sidekiq` generator [#5055]
33
+ ```
34
+ bin/rails generate sidekiq:job ProcessOrderJob
35
+ ```
36
+ - Fix job retries losing CurrentAttributes [#5090]
37
+ - Tweak shutdown to give long-running threads time to cleanup [#5095]
38
+
39
+ 6.3.1
40
+ ---------
41
+
42
+ - Fix keyword arguments error with CurrentAttributes on Ruby 3.0 [#5048]
43
+
44
+ 6.3.0
45
+ ---------
46
+
47
+ - **BREAK**: The Web UI has been refactored to remove jQuery. Any UI extensions
48
+ which use jQuery will break.
49
+ - **FEATURE**: Sidekiq.logger has been enhanced so any `Rails.logger`
50
+ output in jobs now shows up in the Sidekiq console. Remove any logger
51
+ hacks in your initializer and see if it Just Works™ now. [#5021]
52
+ - **FEATURE**: Add `Sidekiq::Job` alias for `Sidekiq::Worker`, to better
53
+ reflect industry standard terminology. You can now do this:
54
+ ```ruby
55
+ class MyJob
56
+ include Sidekiq::Job
57
+ sidekiq_options ...
58
+ def perform(args)
59
+ end
60
+ end
61
+ ```
62
+ - **FEATURE**: Support for serializing ActiveSupport::CurrentAttributes into each job. [#4982]
63
+ ```ruby
64
+ # config/initializers/sidekiq.rb
65
+ require "sidekiq/middleware/current_attributes"
66
+ Sidekiq::CurrentAttributes.persist(Myapp::Current) # Your AS::CurrentAttributes singleton
67
+ ```
68
+ - **FEATURE**: Add `Sidekiq::Worker.perform_bulk` for enqueuing jobs in bulk,
69
+ similar to `Sidekiq::Client.push_bulk` [#5042]
70
+ ```ruby
71
+ MyJob.perform_bulk([[1], [2], [3]])
72
+ ```
73
+ - Implement `queue_as`, `wait` and `wait_until` for ActiveJob compatibility [#5003]
74
+ - Scheduler now uses Lua to reduce Redis load and network roundtrips [#5044]
75
+ - Retry Redis operation if we get an `UNBLOCKED` Redis error [#4985]
76
+ - Run existing signal traps, if any, before running Sidekiq's trap [#4991]
77
+ - Fix fetch bug when using weighted queues which caused Sidekiq to stop
78
+ processing queues randomly [#5031]
79
+
80
+ 6.2.2
81
+ ---------
82
+
83
+ - Reduce retry jitter, add jitter to `sidekiq_retry_in` values [#4957]
84
+ - Minimize scheduler load on Redis at scale [#4882]
85
+ - Improve logging of delay jobs [#4904, BuonOno]
86
+ - Minor CSS improvements for buttons and tables, design PRs always welcome!
87
+ - Tweak Web UI `Cache-Control` header [#4966]
88
+ - Rename internal API class `Sidekiq::Job` to `Sidekiq::JobRecord` [#4955]
89
+
90
+ 6.2.1
91
+ ---------
92
+
93
+ - Update RTT warning logic to handle transient RTT spikes [#4851]
94
+ - Fix very low priority CVE on unescaped queue name [#4852]
95
+ - Add note about sessions and Rails apps in API mode
96
+
97
+ 6.2.0
98
+ ---------
99
+
100
+ - Store Redis RTT and log if poor [#4824]
101
+ - Add process/thread stats to Busy page [#4806]
102
+ - Improve Web UI on mobile devices [#4840]
103
+ - **Refactor Web UI session usage** [#4804]
104
+ Numerous people have hit "Forbidden" errors and struggled with Sidekiq's
105
+ Web UI session requirement. If you have code in your initializer for
106
+ Web sessions, it's quite possible it will need to be removed. Here's
107
+ an overview:
108
+ ```
109
+ Sidekiq::Web needs a valid Rack session for CSRF protection. If this is a Rails app,
110
+ make sure you mount Sidekiq::Web *inside* your routes in `config/routes.rb` so
111
+ Sidekiq can reuse the Rails session:
112
+
113
+ Rails.application.routes.draw do
114
+ mount Sidekiq::Web => "/sidekiq"
115
+ ....
116
+ end
117
+
118
+ If this is a bare Rack app, use a session middleware before Sidekiq::Web:
119
+
120
+ # first, use IRB to create a shared secret key for sessions and commit it
121
+ require 'securerandom'; File.open(".session.key", "w") {|f| f.write(SecureRandom.hex(32)) }
122
+
123
+ # now, update your Rack app to include the secret with a session cookie middleware
124
+ use Rack::Session::Cookie, secret: File.read(".session.key"), same_site: true, max_age: 86400
125
+ run Sidekiq::Web
126
+
127
+ If this is a Rails app in API mode, you need to enable sessions.
128
+
129
+ https://guides.rubyonrails.org/api_app.html#using-session-middlewares
130
+ ```
131
+
132
+ 6.1.3
133
+ ---------
134
+
135
+ - Warn if Redis is configured to evict data under memory pressure [#4752]
136
+ - Add process RSS on the Busy page [#4717]
137
+
138
+ 6.1.2
139
+ ---------
140
+
141
+ - Improve readability in dark mode Web UI [#4674]
142
+ - Fix Web UI crash with corrupt session [#4672]
143
+ - Allow middleware to yield arguments [#4673, @eugeneius]
144
+ - Migrate CI from CircleCI to GitHub Actions [#4677]
145
+
146
+ 6.1.1
147
+ ---------
148
+
149
+ - Jobs are now sorted by age in the Busy Workers table. [#4641]
150
+ - Fix "check all" JS logic in Web UI [#4619]
151
+
152
+ 6.1.0
153
+ ---------
154
+
155
+ - Web UI - Dark Mode fixes [#4543, natematykiewicz]
156
+ - Ensure `Rack::ContentLength` is loaded as middleware for correct Web UI responses [#4541]
157
+ - Avoid exception dumping SSL store in Redis connection logging [#4532]
158
+ - Better error messages in Sidekiq::Client [#4549]
159
+ - Remove rack-protection, reimplement CSRF protection [#4588]
160
+ - Require redis-rb 4.2 [#4591]
161
+ - Update to jquery 1.12.4 [#4593]
162
+ - Refactor internal fetch logic and API [#4602]
163
+
164
+ 6.0.7
165
+ ---------
166
+
167
+ - Refactor systemd integration to work better with custom binaries [#4511]
168
+ - Don't connect to Redis at process exit if not needed [#4502]
169
+ - Remove Redis connection naming [#4479]
170
+ - Fix Redis Sentinel password redaction [#4499]
171
+ - Add Vietnamese locale (vi) [#4528]
172
+
173
+ 6.0.6
174
+ ---------
175
+
176
+ - **Integrate with systemd's watchdog and notification features** [#4488]
177
+ Set `Type=notify` in [sidekiq.service](https://github.com/mperham/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
178
+ - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
179
+ - Fix edge case where a job can be pushed without a queue.
180
+ - Flush job stats at exit [#4498]
181
+ - Check RAILS_ENV before RACK_ENV [#4493]
182
+ - Add Lithuanian locale [#4476]
183
+
184
+ 6.0.5
185
+ ---------
186
+
187
+ - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
188
+ - Update APIs to use `UNLINK`, not `DEL`. [#4449]
189
+ - Fix Ruby 2.7 warnings [#4412]
190
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/mperham/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
191
+
192
+ 6.0.4
193
+ ---------
194
+
195
+ - Fix ActiveJob's `sidekiq_options` integration [#4404]
196
+ - Sidekiq Pro users will now see a Pause button next to each queue in
197
+ the Web UI, allowing them to pause queues manually [#4374, shayonj]
198
+ - Fix Sidekiq::Workers API unintentional change in 6.0.2 [#4387]
199
+
200
+
201
+ 6.0.3
202
+ ---------
203
+
204
+ - Fix `Sidekiq::Client.push_bulk` API which was erroneously putting
205
+ invalid `at` values in the job payloads [#4321]
206
+
207
+ 6.0.2
208
+ ---------
209
+
210
+ - Fix Sidekiq Enterprise's rolling restart functionality, broken by refactoring in 6.0.0. [#4334]
211
+ - More internal refactoring and performance tuning [fatkodima]
212
+
213
+ 6.0.1
214
+ ---------
215
+
216
+ - **Performance tuning**, Sidekiq should be 10-15% faster now [#4303, 4299,
217
+ 4269, fatkodima]
218
+ - **Dark Mode support in Web UI** (further design polish welcome!) [#4227, mperham,
219
+ fatkodima, silent-e]
220
+ - **Job-specific log levels**, allowing you to turn on debugging for
221
+ problematic workers. [fatkodima, #4287]
222
+ ```ruby
223
+ MyWorker.set(log_level: :debug).perform_async(...)
224
+ ```
225
+ - **Ad-hoc job tags**. You can tag your jobs with, e.g, subdomain, tenant, country,
226
+ locale, application, version, user/client, "alpha/beta/pro/ent", types of jobs,
227
+ teams/people responsible for jobs, additional metadata, etc.
228
+ Tags are shown on different pages with job listings. Sidekiq Pro users
229
+ can filter based on them [fatkodima, #4280]
230
+ ```ruby
231
+ class MyWorker
232
+ include Sidekiq::Worker
233
+ sidekiq_options tags: ['bank-ops', 'alpha']
234
+ ...
235
+ end
236
+ ```
237
+ - Fetch scheduled jobs in batches before pushing into specific queues.
238
+ This will decrease enqueueing time of scheduled jobs by a third. [fatkodima, #4273]
239
+ ```
240
+ ScheduledSet with 10,000 jobs
241
+ Before: 56.6 seconds
242
+ After: 39.2 seconds
243
+ ```
244
+ - Compress error backtraces before pushing into Redis, if you are
245
+ storing error backtraces, this will halve the size of your RetrySet
246
+ in Redis [fatkodima, #4272]
247
+ ```
248
+ RetrySet with 100,000 jobs
249
+ Before: 261 MB
250
+ After: 129 MB
251
+ ```
252
+ - Support display of ActiveJob 6.0 payloads in the Web UI [#4263]
253
+ - Add `SortedSet#scan` for pattern based scanning. For large sets this API will be **MUCH** faster
254
+ than standard iteration using each. [fatkodima, #4262]
255
+ ```ruby
256
+ Sidekiq::DeadSet.new.scan("UnreliableApi") do |job|
257
+ job.retry
258
+ end
259
+ ```
260
+ - Dramatically speed up SortedSet#find\_job(jid) by using Redis's ZSCAN
261
+ support, approx 10x faster. [fatkodima, #4259]
262
+ ```
263
+ zscan 0.179366 0.047727 0.227093 ( 1.161376)
264
+ enum 8.522311 0.419826 8.942137 ( 9.785079)
265
+ ```
266
+ - Respect rails' generators `test_framework` option and gracefully handle extra `worker` suffix on generator [fatkodima, #4256]
267
+ - Add ability to sort 'Enqueued' page on Web UI by position in the queue [fatkodima, #4248]
268
+ - Support `Client.push_bulk` with different delays [fatkodima, #4243]
269
+ ```ruby
270
+ Sidekiq::Client.push_bulk("class" => FooJob, "args" => [[1], [2]], "at" => [1.minute.from_now.to_f, 5.minutes.from_now.to_f])
271
+ ```
272
+ - Easier way to test enqueuing specific ActionMailer and ActiveRecord delayed jobs. Instead of manually
273
+ parsing embedded class, you can now test by fetching jobs for specific classes. [fatkodima, #4292]
274
+ ```ruby
275
+ assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs_for(FooMailer).size
276
+ ```
277
+ - Add `sidekiqmon` to gemspec executables [#4242]
278
+ - Gracefully handle `Sidekiq.logger = nil` [#4240]
279
+ - Inject Sidekiq::LogContext module if user-supplied logger does not include it [#4239]
280
+
281
+ 6.0
282
+ ---------
283
+
284
+ This release has major breaking changes. Read and test carefully in production.
285
+
286
+ - With Rails 6.0.2+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
287
+ features/internals like the retry subsystem. [#4213, pirj]
288
+ ```ruby
289
+ class MyJob < ActiveJob::Base
290
+ queue_as :myqueue
291
+ sidekiq_options retry: 10, backtrace: 20
292
+ def perform(...)
293
+ end
294
+ end
295
+ ```
296
+ - Logging has been redesigned to allow for pluggable log formatters:
297
+ ```ruby
298
+ Sidekiq.configure_server do |config|
299
+ config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
300
+ end
301
+ ```
302
+ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for more details.
303
+ - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
304
+ variable. This variable is meant to hold the name of the environment
305
+ variable which contains your Redis URL, so that you can switch Redis
306
+ providers quickly and easily with a single variable change. It is not
307
+ meant to hold the actual Redis URL itself. If you want to manually set
308
+ the Redis URL (not recommended as it implies you have no failover),
309
+ then you may set `REDIS_URL` directly. [#3969]
310
+ - **BREAKING CHANGE** Increase default shutdown timeout from 8 seconds
311
+ to 25 seconds. Both Heroku and ECS now use 30 second shutdown timeout
312
+ by default and we want Sidekiq to take advantage of this time. If you
313
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
314
+ get the old behavior. [#3968]
315
+ - **BREAKING CHANGE** Remove the daemonization, logfile and pidfile
316
+ arguments to Sidekiq. Use a proper process supervisor (e.g. systemd or
317
+ foreman) to manage Sidekiq. See the Deployment wiki page for links to
318
+ more resources.
319
+ - Integrate the StandardRB code formatter to ensure consistent code
320
+ styling. [#4114, gearnode]
4
321
 
5
322
  5.2.9
6
323
  ---------
data/LICENSE CHANGED
@@ -4,6 +4,6 @@ Sidekiq is an Open Source project licensed under the terms of
4
4
  the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
5
  for license text.
6
6
 
7
- Sidekiq Pro has a commercial-friendly license allowing private forks
8
- and modifications of Sidekiq. Please see https://sidekiq.org/products/pro.html for
9
- more detail. You can find the commercial license terms in COMM-LICENSE.
7
+ Sidekiq Pro and Sidekiq Enterprise have a commercial-friendly license.
8
+ You can find the commercial license in COMM-LICENSE.txt.
9
+ Please see https://sidekiq.org for purchasing options.
data/README.md CHANGED
@@ -2,10 +2,7 @@ Sidekiq
2
2
  ==============
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
5
- [![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq)
6
- [![Build Status](https://circleci.com/gh/mperham/sidekiq/tree/master.svg?style=svg)](https://circleci.com/gh/mperham/sidekiq/tree/master)
7
- [![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)
8
-
5
+ ![Build](https://github.com/mperham/sidekiq/workflows/CI/badge.svg)
9
6
 
10
7
  Simple, efficient background processing for Ruby.
11
8
 
@@ -13,32 +10,27 @@ Sidekiq uses threads to handle many jobs at the same time in the
13
10
  same process. It does not require Rails but will integrate tightly with
14
11
  Rails to make background processing dead simple.
15
12
 
16
- Sidekiq is compatible with Resque. It uses the exact same
17
- message format as Resque so it can integrate into an existing Resque processing farm.
18
- You can have Sidekiq and Resque run side-by-side at the same time and
19
- use the Resque client to enqueue jobs in Redis to be processed by Sidekiq.
20
-
21
13
  Performance
22
14
  ---------------
23
15
 
24
- Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput
25
- -----------------|------|---------|---------|------------------------
26
- Sidekiq 4.0.0 | 10ms | 151 MB | 22 sec | **4500 jobs/sec**
27
- Sidekiq 3.5.1 | 22ms | 1257 MB | 125 sec | 800 jobs/sec
28
- Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec
29
- DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec
16
+ Version | Latency | Garbage created for 10k jobs | Time to process 100k jobs | Throughput | Ruby
17
+ -----------------|------|---------|---------|------------------------|-----
18
+ Sidekiq 6.0.2 | 3 ms | 156 MB | 14.0 sec| **7100 jobs/sec** | MRI 2.6.3
19
+ Sidekiq 6.0.0 | 3 ms | 156 MB | 19 sec | 5200 jobs/sec | MRI 2.6.3
20
+ Sidekiq 4.0.0 | 10 ms | 151 MB | 22 sec | 4500 jobs/sec |
21
+ Sidekiq 3.5.1 | 22 ms | 1257 MB | 125 sec | 800 jobs/sec |
22
+ Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec |
23
+ DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec |
30
24
 
31
- <small>This benchmark can be found in `bin/sidekiqload`.</small>
25
+ This benchmark can be found in `bin/sidekiqload` and assumes a Redis network latency of 1ms.
32
26
 
33
27
  Requirements
34
28
  -----------------
35
29
 
36
- Sidekiq supports CRuby 2.2.2+ and JRuby 9k.
30
+ - Redis: 4.0+
31
+ - Ruby: MRI 2.5+ or JRuby 9.2+.
37
32
 
38
- All Rails releases >= 4.0 are officially supported.
39
-
40
- Redis 2.8 or greater is required. 3.0.3+ is recommended for large
41
- installations with thousands of worker threads.
33
+ Sidekiq 6.0 supports Rails 5.0+ but does not require it.
42
34
 
43
35
 
44
36
  Installation
@@ -51,10 +43,10 @@ Getting Started
51
43
  -----------------
52
44
 
53
45
  See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
54
- You can watch [this Youtube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
46
+ You can watch [this YouTube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
55
47
  Sidekiq and see its features in action. Here's the Web UI:
56
48
 
57
- ![Web UI](https://github.com/mperham/sidekiq/raw/master/examples/web-ui.png)
49
+ ![Web UI](https://github.com/mperham/sidekiq/raw/main/examples/web-ui.png)
58
50
 
59
51
 
60
52
  Want to Upgrade?
@@ -63,7 +55,7 @@ Want to Upgrade?
63
55
  I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
64
56
  features, a commercial-friendly license and allow you to support high
65
57
  quality open source development all at the same time. Please see the
66
- [Sidekiq](http://sidekiq.org/) homepage for more detail.
58
+ [Sidekiq](https://sidekiq.org/) homepage for more detail.
67
59
 
68
60
  Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
69
61
  features and changes to Sidekiq and its bigger siblings.
@@ -77,33 +69,30 @@ Problems?
77
69
  If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
78
70
  Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
79
71
 
80
- Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at http://sidekiq.org; email support@contribsys.com for help.
72
+ Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at https://sidekiq.org; email support@contribsys.com for help.
81
73
 
82
74
  Useful resources:
83
75
 
84
76
  * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
85
- * Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
77
+ * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
86
78
  * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q &amp; A.
87
79
 
88
- **No support via Twitter**
89
-
90
80
  Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
91
- See the [Sidekiq support page](http://sidekiq.org/support.html) for details.
81
+ See the [Sidekiq support page](https://sidekiq.org/support.html) for details.
92
82
 
93
- Thanks
83
+ Contributing
94
84
  -----------------
95
85
 
96
- Sidekiq stays fast by using the [JProfiler java profiler](http://www.ej-technologies.com/products/jprofiler/overview.html) to find and fix
97
- performance problems on JRuby. Unfortunately MRI does not have good multithreaded profiling tools.
86
+ Please see [the contributing guidelines](https://github.com/mperham/sidekiq/blob/main/.github/contributing.md).
98
87
 
99
88
 
100
89
  License
101
90
  -----------------
102
91
 
103
- Please see [LICENSE](https://github.com/mperham/sidekiq/blob/master/LICENSE) for licensing details.
92
+ Please see [LICENSE](https://github.com/mperham/sidekiq/blob/main/LICENSE) for licensing details.
104
93
 
105
94
 
106
95
  Author
107
96
  -----------------
108
97
 
109
- Mike Perham, [@mperham](https://twitter.com/mperham) / [@sidekiq](https://twitter.com/sidekiq), [http://www.mikeperham.com](http://www.mikeperham.com) / [http://www.contribsys.com](http://www.contribsys.com)
98
+ Mike Perham, [@getajobmike](https://twitter.com/getajobmike) / [@sidekiq](https://twitter.com/sidekiq), [https://www.mikeperham.com](https://www.mikeperham.com) / [https://www.contribsys.com](https://www.contribsys.com)
data/bin/sidekiq CHANGED
@@ -4,15 +4,39 @@
4
4
  # RUBYOPT=-w bundle exec sidekiq
5
5
  $TESTING = false
6
6
 
7
- require_relative '../lib/sidekiq/cli'
7
+ require_relative "../lib/sidekiq/cli"
8
+
9
+ def integrate_with_systemd
10
+ return unless ENV["NOTIFY_SOCKET"]
11
+
12
+ Sidekiq.configure_server do |config|
13
+ Sidekiq.logger.info "Enabling systemd notification integration"
14
+ require "sidekiq/sd_notify"
15
+ config.on(:startup) do
16
+ Sidekiq::SdNotify.ready
17
+ end
18
+ config.on(:shutdown) do
19
+ Sidekiq::SdNotify.stopping
20
+ end
21
+ Sidekiq.start_watchdog if Sidekiq::SdNotify.watchdog?
22
+ end
23
+ end
8
24
 
9
25
  begin
10
26
  cli = Sidekiq::CLI.instance
11
27
  cli.parse
28
+
29
+ integrate_with_systemd
30
+
12
31
  cli.run
13
32
  rescue => e
14
33
  raise e if $DEBUG
15
- STDERR.puts e.message
16
- STDERR.puts e.backtrace.join("\n")
34
+ if Sidekiq.error_handlers.length == 0
35
+ warn e.message
36
+ warn e.backtrace.join("\n")
37
+ else
38
+ cli.handle_exception e
39
+ end
40
+
17
41
  exit 1
18
42
  end