sidekiq 4.2.10 → 6.5.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 (119) hide show
  1. checksums.yaml +5 -5
  2. data/Changes.md +533 -1
  3. data/LICENSE +3 -3
  4. data/README.md +25 -34
  5. data/bin/sidekiq +27 -3
  6. data/bin/sidekiqload +81 -74
  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/job_spec.rb.erb +6 -0
  11. data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
  12. data/lib/sidekiq/.DS_Store +0 -0
  13. data/lib/sidekiq/api.rb +455 -272
  14. data/lib/sidekiq/cli.rb +255 -233
  15. data/lib/sidekiq/client.rb +86 -83
  16. data/lib/sidekiq/component.rb +64 -0
  17. data/lib/sidekiq/delay.rb +43 -0
  18. data/lib/sidekiq/extensions/action_mailer.rb +13 -22
  19. data/lib/sidekiq/extensions/active_record.rb +13 -10
  20. data/lib/sidekiq/extensions/class_methods.rb +14 -11
  21. data/lib/sidekiq/extensions/generic_proxy.rb +13 -5
  22. data/lib/sidekiq/fetch.rb +49 -39
  23. data/lib/sidekiq/job.rb +13 -0
  24. data/lib/sidekiq/job_logger.rb +51 -0
  25. data/lib/sidekiq/job_retry.rb +262 -0
  26. data/lib/sidekiq/job_util.rb +71 -0
  27. data/lib/sidekiq/launcher.rb +182 -90
  28. data/lib/sidekiq/logger.rb +156 -0
  29. data/lib/sidekiq/manager.rb +43 -45
  30. data/lib/sidekiq/middleware/chain.rb +42 -21
  31. data/lib/sidekiq/middleware/current_attributes.rb +61 -0
  32. data/lib/sidekiq/middleware/i18n.rb +7 -7
  33. data/lib/sidekiq/middleware/modules.rb +21 -0
  34. data/lib/sidekiq/monitor.rb +133 -0
  35. data/lib/sidekiq/paginator.rb +20 -16
  36. data/lib/sidekiq/processor.rb +170 -91
  37. data/lib/sidekiq/rails.rb +41 -96
  38. data/lib/sidekiq/redis_client_adapter.rb +154 -0
  39. data/lib/sidekiq/redis_connection.rb +118 -47
  40. data/lib/sidekiq/ring_buffer.rb +29 -0
  41. data/lib/sidekiq/scheduled.rb +102 -40
  42. data/lib/sidekiq/sd_notify.rb +149 -0
  43. data/lib/sidekiq/systemd.rb +24 -0
  44. data/lib/sidekiq/testing/inline.rb +6 -5
  45. data/lib/sidekiq/testing.rb +80 -61
  46. data/lib/sidekiq/transaction_aware_client.rb +45 -0
  47. data/lib/sidekiq/version.rb +2 -1
  48. data/lib/sidekiq/web/action.rb +15 -15
  49. data/lib/sidekiq/web/application.rb +116 -86
  50. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  51. data/lib/sidekiq/web/helpers.rb +147 -83
  52. data/lib/sidekiq/web/router.rb +23 -19
  53. data/lib/sidekiq/web.rb +65 -109
  54. data/lib/sidekiq/worker.rb +286 -40
  55. data/lib/sidekiq.rb +178 -78
  56. data/sidekiq.gemspec +23 -27
  57. data/web/assets/images/apple-touch-icon.png +0 -0
  58. data/web/assets/javascripts/application.js +112 -61
  59. data/web/assets/javascripts/dashboard.js +81 -85
  60. data/web/assets/stylesheets/application-dark.css +143 -0
  61. data/web/assets/stylesheets/application-rtl.css +242 -0
  62. data/web/assets/stylesheets/application.css +320 -143
  63. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  64. data/web/assets/stylesheets/bootstrap.css +2 -2
  65. data/web/locales/ar.yml +87 -0
  66. data/web/locales/de.yml +14 -2
  67. data/web/locales/en.yml +8 -1
  68. data/web/locales/es.yml +22 -5
  69. data/web/locales/fa.yml +1 -0
  70. data/web/locales/fr.yml +10 -3
  71. data/web/locales/he.yml +79 -0
  72. data/web/locales/ja.yml +12 -4
  73. data/web/locales/lt.yml +83 -0
  74. data/web/locales/pl.yml +4 -4
  75. data/web/locales/pt-br.yml +27 -9
  76. data/web/locales/ru.yml +4 -0
  77. data/web/locales/ur.yml +80 -0
  78. data/web/locales/vi.yml +83 -0
  79. data/web/views/_footer.erb +5 -2
  80. data/web/views/_job_info.erb +3 -2
  81. data/web/views/_nav.erb +4 -18
  82. data/web/views/_paging.erb +1 -1
  83. data/web/views/_poll_link.erb +2 -5
  84. data/web/views/_summary.erb +7 -7
  85. data/web/views/busy.erb +61 -23
  86. data/web/views/dashboard.erb +23 -15
  87. data/web/views/dead.erb +3 -3
  88. data/web/views/layout.erb +14 -3
  89. data/web/views/morgue.erb +9 -6
  90. data/web/views/queue.erb +22 -12
  91. data/web/views/queues.erb +12 -2
  92. data/web/views/retries.erb +14 -7
  93. data/web/views/retry.erb +3 -3
  94. data/web/views/scheduled.erb +7 -4
  95. metadata +53 -208
  96. data/.github/contributing.md +0 -32
  97. data/.github/issue_template.md +0 -9
  98. data/.gitignore +0 -12
  99. data/.travis.yml +0 -18
  100. data/3.0-Upgrade.md +0 -70
  101. data/4.0-Upgrade.md +0 -53
  102. data/COMM-LICENSE +0 -95
  103. data/Ent-Changes.md +0 -173
  104. data/Gemfile +0 -29
  105. data/Pro-2.0-Upgrade.md +0 -138
  106. data/Pro-3.0-Upgrade.md +0 -44
  107. data/Pro-Changes.md +0 -628
  108. data/Rakefile +0 -12
  109. data/bin/sidekiqctl +0 -99
  110. data/code_of_conduct.md +0 -50
  111. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +0 -6
  112. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  113. data/lib/sidekiq/core_ext.rb +0 -119
  114. data/lib/sidekiq/exception_handler.rb +0 -31
  115. data/lib/sidekiq/logging.rb +0 -106
  116. data/lib/sidekiq/middleware/server/active_record.rb +0 -13
  117. data/lib/sidekiq/middleware/server/logging.rb +0 -31
  118. data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -205
  119. data/lib/sidekiq/util.rb +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 595500a3810c25e8e04e86c644f966ff01cb035f
4
- data.tar.gz: 3f92a9f61e61848bc2c0639469ce3588f3848fc0
2
+ SHA256:
3
+ metadata.gz: 1afbc6a1a0b14403e9148e746c08e0a2b24e634fca05288982c96719675607de
4
+ data.tar.gz: 3ff3f8df76b565f42030462eb8d09b673b89751dcd6a0b7c41a255789960d321
5
5
  SHA512:
6
- metadata.gz: c4e97c3665d1e902f47cfb579fda437dc834ac4b584606f1ca3b8fd9225e8502cacf5fb687673b4735b359de6af179589759a34369f1c74e904b37f8fe70a4ee
7
- data.tar.gz: a4e6d41067bf6b88c77577def0c1f9ecc3f5d46f0bdfb0821952c26867e91a71c64231aab09a25096d22c3272dea2dcc37547bc6096dd7622a192fa00e0a4e50
6
+ metadata.gz: e8a68611735322d98cc517f1d03ef02394497f8eb505e0db496909cac1f6b7f0179f38ce1966546f717115395102c78fdad9ae0fd947360307b9288dcc22b369
7
+ data.tar.gz: 163e41dfb153a4e2ec50d407bde08cb8a395909807053f24478a73af1a6a9858b5aec92cbf618d4d066560a2b7bedaa2f88b48f823609e2d78f21320270cb97e
data/Changes.md CHANGED
@@ -1,6 +1,538 @@
1
1
  # Sidekiq Changes
2
2
 
3
- HEAD
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
+ 6.5.1
6
+ ----------
7
+
8
+ - Fix `push_bulk` breakage [#5387]
9
+
10
+ 6.5.0
11
+ ---------
12
+
13
+ - Substantial refactoring of Sidekiq server internals, part of a larger effort
14
+ to reduce Sidekiq's internal usage of global methods and data, see [docs/global_to_local.md](docs/global_to_local.md) and [docs/middleware.md](docs/middleware.md).
15
+ - **Add beta support for the `redis-client` gem**. This will become the default Redis driver in Sidekiq 7.0. [#5298]
16
+ Read more: https://github.com/mperham/sidekiq/wiki/Using-redis-client
17
+ - **Add beta support for DB transaction-aware client** [#5291]
18
+ Add this line to your initializer and any jobs created during a transaction
19
+ will only be pushed to Redis **after the transaction commits**. You will need to add the
20
+ `after_commit_everywhere` gem to your Gemfile.
21
+ ```ruby
22
+ Sidekiq.transactional_push!
23
+ ```
24
+ This feature does not have a lot of production usage yet; please try it out and let us
25
+ know if you have any issues. It will be fully supported in Sidekiq 7.0 or removed if it
26
+ proves problematic.
27
+ - Fix regression with middleware arguments [#5312]
28
+
29
+ 6.4.2
30
+ ---------
31
+
32
+ - Strict argument checking now runs after client-side middleware [#5246]
33
+ - Fix page events with live polling [#5184]
34
+ - Many under-the-hood changes to remove all usage of the term "worker"
35
+ from the Sidekiq codebase and APIs. This mostly involved RDoc and local
36
+ variable names but a few constants and public APIs were changed. The old
37
+ APIs will be removed in Sidekiq 7.0.
38
+ ```
39
+ Sidekiq::DEFAULT_WORKER_OPTIONS -> Sidekiq.default_job_options
40
+ Sidekiq.default_worker_options -> Sidekiq.default_job_options
41
+ Sidekiq::Queues["default"].jobs_by_worker(HardJob) -> Sidekiq::Queues["default"].jobs_by_class(HardJob)
42
+ ```
43
+
44
+ 6.4.1
45
+ ---------
46
+
47
+ - Fix pipeline/multi deprecations in redis-rb 4.6
48
+ - Fix sidekiq.yml YAML load errors on Ruby 3.1 [#5141]
49
+ - Sharding support for `perform_bulk` [#5129]
50
+ - Refactor job logger for SPEEEEEEED
51
+
52
+ 6.4.0
53
+ ---------
54
+
55
+ - **SECURITY**: Validate input to avoid possible DoS in Web UI.
56
+ - Add **strict argument checking** [#5071]
57
+ Sidekiq will now log a warning if JSON-unsafe arguments are passed to `perform_async`.
58
+ Add `Sidekiq.strict_args!(false)` to your initializer to disable this warning.
59
+ This warning will switch to an exception in Sidekiq 7.0.
60
+ - Note that Delayed Extensions will be removed in Sidekiq 7.0 [#5076]
61
+ - Add `perform_{inline,sync}` in Sidekiq::Job to run a job synchronously [#5061, hasan-ally]
62
+ ```ruby
63
+ SomeJob.perform_async(args...)
64
+ SomeJob.perform_sync(args...)
65
+ SomeJob.perform_inline(args...)
66
+ ```
67
+ You can also dynamically redirect a job to run synchronously:
68
+ ```ruby
69
+ SomeJob.set("sync": true).perform_async(args...) # will run via perform_inline
70
+ ```
71
+ - Replace Sidekiq::Worker `app/workers` generator with Sidekiq::Job `app/sidekiq` generator [#5055]
72
+ ```
73
+ bin/rails generate sidekiq:job ProcessOrderJob
74
+ ```
75
+ - Fix job retries losing CurrentAttributes [#5090]
76
+ - Tweak shutdown to give long-running threads time to cleanup [#5095]
77
+
78
+ 6.3.1
79
+ ---------
80
+
81
+ - Fix keyword arguments error with CurrentAttributes on Ruby 3.0 [#5048]
82
+
83
+ 6.3.0
84
+ ---------
85
+
86
+ - **BREAK**: The Web UI has been refactored to remove jQuery. Any UI extensions
87
+ which use jQuery will break.
88
+ - **FEATURE**: Sidekiq.logger has been enhanced so any `Rails.logger`
89
+ output in jobs now shows up in the Sidekiq console. Remove any logger
90
+ hacks in your initializer and see if it Just Works™ now. [#5021]
91
+ - **FEATURE**: Add `Sidekiq::Job` alias for `Sidekiq::Worker`, to better
92
+ reflect industry standard terminology. You can now do this:
93
+ ```ruby
94
+ class MyJob
95
+ include Sidekiq::Job
96
+ sidekiq_options ...
97
+ def perform(args)
98
+ end
99
+ end
100
+ ```
101
+ - **FEATURE**: Support for serializing ActiveSupport::CurrentAttributes into each job. [#4982]
102
+ ```ruby
103
+ # config/initializers/sidekiq.rb
104
+ require "sidekiq/middleware/current_attributes"
105
+ Sidekiq::CurrentAttributes.persist(Myapp::Current) # Your AS::CurrentAttributes singleton
106
+ ```
107
+ - **FEATURE**: Add `Sidekiq::Worker.perform_bulk` for enqueuing jobs in bulk,
108
+ similar to `Sidekiq::Client.push_bulk` [#5042]
109
+ ```ruby
110
+ MyJob.perform_bulk([[1], [2], [3]])
111
+ ```
112
+ - Implement `queue_as`, `wait` and `wait_until` for ActiveJob compatibility [#5003]
113
+ - Scheduler now uses Lua to reduce Redis load and network roundtrips [#5044]
114
+ - Retry Redis operation if we get an `UNBLOCKED` Redis error [#4985]
115
+ - Run existing signal traps, if any, before running Sidekiq's trap [#4991]
116
+ - Fix fetch bug when using weighted queues which caused Sidekiq to stop
117
+ processing queues randomly [#5031]
118
+
119
+ 6.2.2
120
+ ---------
121
+
122
+ - Reduce retry jitter, add jitter to `sidekiq_retry_in` values [#4957]
123
+ - Minimize scheduler load on Redis at scale [#4882]
124
+ - Improve logging of delay jobs [#4904, BuonOno]
125
+ - Minor CSS improvements for buttons and tables, design PRs always welcome!
126
+ - Tweak Web UI `Cache-Control` header [#4966]
127
+ - Rename internal API class `Sidekiq::Job` to `Sidekiq::JobRecord` [#4955]
128
+
129
+ 6.2.1
130
+ ---------
131
+
132
+ - Update RTT warning logic to handle transient RTT spikes [#4851]
133
+ - Fix very low priority CVE on unescaped queue name [#4852]
134
+ - Add note about sessions and Rails apps in API mode
135
+
136
+ 6.2.0
137
+ ---------
138
+
139
+ - Store Redis RTT and log if poor [#4824]
140
+ - Add process/thread stats to Busy page [#4806]
141
+ - Improve Web UI on mobile devices [#4840]
142
+ - **Refactor Web UI session usage** [#4804]
143
+ Numerous people have hit "Forbidden" errors and struggled with Sidekiq's
144
+ Web UI session requirement. If you have code in your initializer for
145
+ Web sessions, it's quite possible it will need to be removed. Here's
146
+ an overview:
147
+ ```
148
+ Sidekiq::Web needs a valid Rack session for CSRF protection. If this is a Rails app,
149
+ make sure you mount Sidekiq::Web *inside* your routes in `config/routes.rb` so
150
+ Sidekiq can reuse the Rails session:
151
+
152
+ Rails.application.routes.draw do
153
+ mount Sidekiq::Web => "/sidekiq"
154
+ ....
155
+ end
156
+
157
+ If this is a bare Rack app, use a session middleware before Sidekiq::Web:
158
+
159
+ # first, use IRB to create a shared secret key for sessions and commit it
160
+ require 'securerandom'; File.open(".session.key", "w") {|f| f.write(SecureRandom.hex(32)) }
161
+
162
+ # now, update your Rack app to include the secret with a session cookie middleware
163
+ use Rack::Session::Cookie, secret: File.read(".session.key"), same_site: true, max_age: 86400
164
+ run Sidekiq::Web
165
+
166
+ If this is a Rails app in API mode, you need to enable sessions.
167
+
168
+ https://guides.rubyonrails.org/api_app.html#using-session-middlewares
169
+ ```
170
+
171
+ 6.1.3
172
+ ---------
173
+
174
+ - Warn if Redis is configured to evict data under memory pressure [#4752]
175
+ - Add process RSS on the Busy page [#4717]
176
+
177
+ 6.1.2
178
+ ---------
179
+
180
+ - Improve readability in dark mode Web UI [#4674]
181
+ - Fix Web UI crash with corrupt session [#4672]
182
+ - Allow middleware to yield arguments [#4673, @eugeneius]
183
+ - Migrate CI from CircleCI to GitHub Actions [#4677]
184
+
185
+ 6.1.1
186
+ ---------
187
+
188
+ - Jobs are now sorted by age in the Busy Workers table. [#4641]
189
+ - Fix "check all" JS logic in Web UI [#4619]
190
+
191
+ 6.1.0
192
+ ---------
193
+
194
+ - Web UI - Dark Mode fixes [#4543, natematykiewicz]
195
+ - Ensure `Rack::ContentLength` is loaded as middleware for correct Web UI responses [#4541]
196
+ - Avoid exception dumping SSL store in Redis connection logging [#4532]
197
+ - Better error messages in Sidekiq::Client [#4549]
198
+ - Remove rack-protection, reimplement CSRF protection [#4588]
199
+ - Require redis-rb 4.2 [#4591]
200
+ - Update to jquery 1.12.4 [#4593]
201
+ - Refactor internal fetch logic and API [#4602]
202
+
203
+ 6.0.7
204
+ ---------
205
+
206
+ - Refactor systemd integration to work better with custom binaries [#4511]
207
+ - Don't connect to Redis at process exit if not needed [#4502]
208
+ - Remove Redis connection naming [#4479]
209
+ - Fix Redis Sentinel password redaction [#4499]
210
+ - Add Vietnamese locale (vi) [#4528]
211
+
212
+ 6.0.6
213
+ ---------
214
+
215
+ - **Integrate with systemd's watchdog and notification features** [#4488]
216
+ Set `Type=notify` in [sidekiq.service](https://github.com/mperham/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
217
+ - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
218
+ - Fix edge case where a job can be pushed without a queue.
219
+ - Flush job stats at exit [#4498]
220
+ - Check RAILS_ENV before RACK_ENV [#4493]
221
+ - Add Lithuanian locale [#4476]
222
+
223
+ 6.0.5
224
+ ---------
225
+
226
+ - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
227
+ - Update APIs to use `UNLINK`, not `DEL`. [#4449]
228
+ - Fix Ruby 2.7 warnings [#4412]
229
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/mperham/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
230
+
231
+ 6.0.4
232
+ ---------
233
+
234
+ - Fix ActiveJob's `sidekiq_options` integration [#4404]
235
+ - Sidekiq Pro users will now see a Pause button next to each queue in
236
+ the Web UI, allowing them to pause queues manually [#4374, shayonj]
237
+ - Fix Sidekiq::Workers API unintentional change in 6.0.2 [#4387]
238
+
239
+
240
+ 6.0.3
241
+ ---------
242
+
243
+ - Fix `Sidekiq::Client.push_bulk` API which was erroneously putting
244
+ invalid `at` values in the job payloads [#4321]
245
+
246
+ 6.0.2
247
+ ---------
248
+
249
+ - Fix Sidekiq Enterprise's rolling restart functionality, broken by refactoring in 6.0.0. [#4334]
250
+ - More internal refactoring and performance tuning [fatkodima]
251
+
252
+ 6.0.1
253
+ ---------
254
+
255
+ - **Performance tuning**, Sidekiq should be 10-15% faster now [#4303, 4299,
256
+ 4269, fatkodima]
257
+ - **Dark Mode support in Web UI** (further design polish welcome!) [#4227, mperham,
258
+ fatkodima, silent-e]
259
+ - **Job-specific log levels**, allowing you to turn on debugging for
260
+ problematic workers. [fatkodima, #4287]
261
+ ```ruby
262
+ MyWorker.set(log_level: :debug).perform_async(...)
263
+ ```
264
+ - **Ad-hoc job tags**. You can tag your jobs with, e.g, subdomain, tenant, country,
265
+ locale, application, version, user/client, "alpha/beta/pro/ent", types of jobs,
266
+ teams/people responsible for jobs, additional metadata, etc.
267
+ Tags are shown on different pages with job listings. Sidekiq Pro users
268
+ can filter based on them [fatkodima, #4280]
269
+ ```ruby
270
+ class MyWorker
271
+ include Sidekiq::Worker
272
+ sidekiq_options tags: ['bank-ops', 'alpha']
273
+ ...
274
+ end
275
+ ```
276
+ - Fetch scheduled jobs in batches before pushing into specific queues.
277
+ This will decrease enqueueing time of scheduled jobs by a third. [fatkodima, #4273]
278
+ ```
279
+ ScheduledSet with 10,000 jobs
280
+ Before: 56.6 seconds
281
+ After: 39.2 seconds
282
+ ```
283
+ - Compress error backtraces before pushing into Redis, if you are
284
+ storing error backtraces, this will halve the size of your RetrySet
285
+ in Redis [fatkodima, #4272]
286
+ ```
287
+ RetrySet with 100,000 jobs
288
+ Before: 261 MB
289
+ After: 129 MB
290
+ ```
291
+ - Support display of ActiveJob 6.0 payloads in the Web UI [#4263]
292
+ - Add `SortedSet#scan` for pattern based scanning. For large sets this API will be **MUCH** faster
293
+ than standard iteration using each. [fatkodima, #4262]
294
+ ```ruby
295
+ Sidekiq::DeadSet.new.scan("UnreliableApi") do |job|
296
+ job.retry
297
+ end
298
+ ```
299
+ - Dramatically speed up SortedSet#find\_job(jid) by using Redis's ZSCAN
300
+ support, approx 10x faster. [fatkodima, #4259]
301
+ ```
302
+ zscan 0.179366 0.047727 0.227093 ( 1.161376)
303
+ enum 8.522311 0.419826 8.942137 ( 9.785079)
304
+ ```
305
+ - Respect rails' generators `test_framework` option and gracefully handle extra `worker` suffix on generator [fatkodima, #4256]
306
+ - Add ability to sort 'Enqueued' page on Web UI by position in the queue [fatkodima, #4248]
307
+ - Support `Client.push_bulk` with different delays [fatkodima, #4243]
308
+ ```ruby
309
+ Sidekiq::Client.push_bulk("class" => FooJob, "args" => [[1], [2]], "at" => [1.minute.from_now.to_f, 5.minutes.from_now.to_f])
310
+ ```
311
+ - Easier way to test enqueuing specific ActionMailer and ActiveRecord delayed jobs. Instead of manually
312
+ parsing embedded class, you can now test by fetching jobs for specific classes. [fatkodima, #4292]
313
+ ```ruby
314
+ assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs_for(FooMailer).size
315
+ ```
316
+ - Add `sidekiqmon` to gemspec executables [#4242]
317
+ - Gracefully handle `Sidekiq.logger = nil` [#4240]
318
+ - Inject Sidekiq::LogContext module if user-supplied logger does not include it [#4239]
319
+
320
+ 6.0
321
+ ---------
322
+
323
+ This release has major breaking changes. Read and test carefully in production.
324
+
325
+ - With Rails 6.0.2+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
326
+ features/internals like the retry subsystem. [#4213, pirj]
327
+ ```ruby
328
+ class MyJob < ActiveJob::Base
329
+ queue_as :myqueue
330
+ sidekiq_options retry: 10, backtrace: 20
331
+ def perform(...)
332
+ end
333
+ end
334
+ ```
335
+ - Logging has been redesigned to allow for pluggable log formatters:
336
+ ```ruby
337
+ Sidekiq.configure_server do |config|
338
+ config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
339
+ end
340
+ ```
341
+ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for more details.
342
+ - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
343
+ variable. This variable is meant to hold the name of the environment
344
+ variable which contains your Redis URL, so that you can switch Redis
345
+ providers quickly and easily with a single variable change. It is not
346
+ meant to hold the actual Redis URL itself. If you want to manually set
347
+ the Redis URL (not recommended as it implies you have no failover),
348
+ then you may set `REDIS_URL` directly. [#3969]
349
+ - **BREAKING CHANGE** Increase default shutdown timeout from 8 seconds
350
+ to 25 seconds. Both Heroku and ECS now use 30 second shutdown timeout
351
+ by default and we want Sidekiq to take advantage of this time. If you
352
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
353
+ get the old behavior. [#3968]
354
+ - **BREAKING CHANGE** Remove the daemonization, logfile and pidfile
355
+ arguments to Sidekiq. Use a proper process supervisor (e.g. systemd or
356
+ foreman) to manage Sidekiq. See the Deployment wiki page for links to
357
+ more resources.
358
+ - Integrate the StandardRB code formatter to ensure consistent code
359
+ styling. [#4114, gearnode]
360
+
361
+ 5.2.10
362
+ ---------
363
+
364
+ - Backport fix for CVE-2022-23837.
365
+ - Migrate to `exists?` for redis-rb.
366
+ - Lock redis-rb to <4.6 to avoid deprecations.
367
+
368
+ 5.2.9
369
+ ---------
370
+
371
+ - Release Rack lock due to a cascade of CVEs. [#4566]
372
+ Pro-tip: don't lock Rack.
373
+
374
+ 5.2.8
375
+ ---------
376
+
377
+ - Lock to Rack 2.0.x to prevent future incompatibilities
378
+ - Fix invalid reference in `sidekiqctl`
379
+
380
+ 5.2.7
381
+ ---------
382
+
383
+ - Fix stale `enqueued_at` when retrying [#4149]
384
+ - Move build to [Circle CI](https://circleci.com/gh/mperham/sidekiq) [#4120]
385
+
386
+ 5.2.6
387
+ ---------
388
+
389
+ - Fix edge case where a job failure during Redis outage could result in a lost job [#4141]
390
+ - Better handling of malformed job arguments in payload [#4095]
391
+ - Restore bootstap's dropdown css component [#4099, urkle]
392
+ - Display human-friendly time diff for longer queue latencies [#4111, interlinked]
393
+ - Allow `Sidekiq::Worker#set` to be chained
394
+
395
+ 5.2.5
396
+ ---------
397
+
398
+ - Fix default usage of `config/sidekiq.yml` [#4077, Tensho]
399
+
400
+ 5.2.4
401
+ ---------
402
+
403
+ - Add warnings for various deprecations and changes coming in Sidekiq 6.0.
404
+ See the 6-0 branch. [#4056]
405
+ - Various improvements to the Sidekiq test suite and coverage [#4026, #4039, Tensho]
406
+
407
+ 5.2.3
408
+ ---------
409
+
410
+ - Warning message on invalid REDIS\_PROVIDER [#3970]
411
+ - Add `sidekiqctl status` command [#4003, dzunk]
412
+ - Update elapsed time calculatons to use monotonic clock [#3999]
413
+ - Fix a few issues with mobile Web UI styling [#3973, navied]
414
+ - Jobs with `retry: false` now go through the global `death_handlers`,
415
+ meaning you can take action on failed ephemeral jobs. [#3980, Benjamin-Dobell]
416
+ - Fix race condition in defining Workers. [#3997, mattbooks]
417
+
418
+ 5.2.2
419
+ ---------
420
+
421
+ - Raise error for duplicate queue names in config to avoid unexpected fetch algorithm change [#3911]
422
+ - Fix concurrency bug on JRuby [#3958, mattbooks]
423
+ - Add "Kill All" button to the retries page [#3938]
424
+
425
+ 5.2.1
426
+ -----------
427
+
428
+ - Fix concurrent modification error during heartbeat [#3921]
429
+
430
+ 5.2.0
431
+ -----------
432
+
433
+ - **Decrease default concurrency from 25 to 10** [#3892]
434
+ - Verify connection pool sizing upon startup [#3917]
435
+ - Smoother scheduling for large Sidekiq clusters [#3889]
436
+ - Switch Sidekiq::Testing impl from alias\_method to Module#prepend, for resiliency [#3852]
437
+ - Update Sidekiq APIs to use SCAN for scalability [#3848, ffiller]
438
+ - Remove concurrent-ruby gem dependency [#3830]
439
+ - Optimize Web UI's bootstrap.css [#3914]
440
+
441
+ 5.1.3
442
+ -----------
443
+
444
+ - Fix version comparison so Ruby 2.2.10 works. [#3808, nateberkopec]
445
+
446
+ 5.1.2
447
+ -----------
448
+
449
+ - Add link to docs in Web UI footer
450
+ - Fix crash on Ctrl-C in Windows [#3775, Bernica]
451
+ - Remove `freeze` calls on String constants. This is superfluous with Ruby
452
+ 2.3+ and `frozen_string_literal: true`. [#3759]
453
+ - Fix use of AR middleware outside of Rails [#3787]
454
+ - Sidekiq::Worker `sidekiq_retry_in` block can now return nil or 0 to use
455
+ the default backoff delay [#3796, dsalahutdinov]
456
+
457
+ 5.1.1
458
+ -----------
459
+
460
+ - Fix Web UI incompatibility with Redis 3.x gem [#3749]
461
+
462
+ 5.1.0
463
+ -----------
464
+
465
+ - **NEW** Global death handlers - called when your job exhausts all
466
+ retries and dies. Now you can take action when a job fails permanently. [#3721]
467
+ - **NEW** Enable ActiveRecord query cache within jobs by default [#3718, sobrinho]
468
+ This will prevent duplicate SELECTS; cache is cleared upon any UPDATE/INSERT/DELETE.
469
+ See the issue for how to bypass the cache or disable it completely.
470
+ - Scheduler timing is now more accurate, 15 -> 5 seconds [#3734]
471
+ - Exceptions during the :startup event will now kill the process [#3717]
472
+ - Make `Sidekiq::Client.via` reentrant [#3715]
473
+ - Fix use of Sidekiq logger outside of the server process [#3714]
474
+ - Tweak `constantize` to better match Rails class lookup. [#3701, caffeinated-tech]
475
+
476
+ 5.0.5
477
+ -----------
478
+
479
+ - Update gemspec to allow newer versions of the Redis gem [#3617]
480
+ - Refactor Worker.set so it can be memoized [#3602]
481
+ - Fix display of Redis URL in web footer, broken in 5.0.3 [#3560]
482
+ - Update `Sidekiq::Job#display_args` to avoid mutation [#3621]
483
+
484
+ 5.0.4
485
+ -----------
486
+
487
+ - Fix "slow startup" performance regression from 5.0.2. [#3525]
488
+ - Allow users to disable ID generation since some redis providers disable the CLIENT command. [#3521]
489
+
490
+ 5.0.3
491
+ -----------
492
+
493
+ - Fix overriding `class_attribute` core extension from ActiveSupport with Sidekiq one [PikachuEXE, #3499]
494
+ - Allow job logger to be overridden [AlfonsoUceda, #3502]
495
+ - Set a default Redis client identifier for debugging [#3516]
496
+ - Fix "Uninitialized constant" errors on startup with the delayed extensions [#3509]
497
+
498
+ 5.0.2
499
+ -----------
500
+
501
+ - fix broken release, thanks @nateberkopec
502
+
503
+ 5.0.1
504
+ -----------
505
+
506
+ - Fix incorrect server identity when daemonizing [jwilm, #3496]
507
+ - Work around error running Web UI against Redis Cluster [#3492]
508
+ - Remove core extensions, Sidekiq is now monkeypatch-free! [#3474]
509
+ - Reimplement Web UI's HTTP\_ACCEPT\_LANGUAGE parsing because the spec is utterly
510
+ incomprehensible for various edge cases. [johanlunds, natematykiewicz, #3449]
511
+ - Update `class_attribute` core extension to avoid warnings
512
+ - Expose `job_hash_context` from `Sidekiq::Logging` to support log customization
513
+
514
+ 5.0.0
515
+ -----------
516
+
517
+ - **BREAKING CHANGE** Job dispatch was refactored for safer integration with
518
+ Rails 5. The **Logging** and **RetryJobs** server middleware were removed and
519
+ functionality integrated directly into Sidekiq::Processor. These aren't
520
+ commonly used public APIs so this shouldn't impact most users.
521
+ ```
522
+ Sidekiq::Middleware::Server::RetryJobs -> Sidekiq::JobRetry
523
+ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
524
+ ```
525
+ - Quieting Sidekiq is now done via the TSTP signal, the USR1 signal is deprecated.
526
+ - The `delay` extension APIs are no longer available by default, you
527
+ must opt into them.
528
+ - The Web UI is now BiDi and can render RTL languages like Arabic, Farsi and Hebrew.
529
+ - Rails 3.2 and Ruby 2.0 and 2.1 are no longer supported.
530
+ - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
531
+ - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
532
+ of random hex bytes.
533
+ - Please see the [5.0 Upgrade notes](5.0-Upgrade.md) for more detail.
534
+
535
+ 4.2.10
4
536
  -----------
5
537
 
6
538
  - Scheduled jobs can now be moved directly to the Dead queue via API [#3390]
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 http://sidekiq.org/pro/ 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://travis-ci.org/mperham/sidekiq.svg)](https://travis-ci.org/mperham/sidekiq)
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,47 +10,43 @@ 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
 
25
+ This benchmark can be found in `bin/sidekiqload` and assumes a Redis network latency of 1ms.
31
26
 
32
27
  Requirements
33
28
  -----------------
34
29
 
35
- Sidekiq supports CRuby 2.0+ and JRuby 9k.
36
-
37
- All Rails releases >= 3.2 are officially supported.
30
+ - Redis: 4.0+
31
+ - Ruby: MRI 2.5+ or JRuby 9.2+.
38
32
 
39
- Redis 2.8 or greater is required. 3.0.3+ is recommended for large
40
- installations with thousands of worker threads.
33
+ Sidekiq 6.0 supports Rails 5.0+ but does not require it.
41
34
 
42
35
 
43
36
  Installation
44
37
  -----------------
45
38
 
46
- gem install sidekiq
39
+ bundle add sidekiq
47
40
 
48
41
 
49
42
  Getting Started
50
43
  -----------------
51
44
 
52
45
  See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
53
- 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
54
47
  Sidekiq and see its features in action. Here's the Web UI:
55
48
 
56
- ![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)
57
50
 
58
51
 
59
52
  Want to Upgrade?
@@ -62,7 +55,7 @@ Want to Upgrade?
62
55
  I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
63
56
  features, a commercial-friendly license and allow you to support high
64
57
  quality open source development all at the same time. Please see the
65
- [Sidekiq](http://sidekiq.org/) homepage for more detail.
58
+ [Sidekiq](https://sidekiq.org/) homepage for more detail.
66
59
 
67
60
  Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
68
61
  features and changes to Sidekiq and its bigger siblings.
@@ -76,32 +69,30 @@ Problems?
76
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.
77
70
  Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
78
71
 
72
+ Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at https://sidekiq.org; email support@contribsys.com for help.
73
+
79
74
  Useful resources:
80
75
 
81
76
  * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
82
- * Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
83
- * Here's a [Reddit forum](https://reddit.com/r/sidekiq) dedicated to Sidekiq discussion
77
+ * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
84
78
  * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q &amp; A.
85
79
 
86
- **No support via Twitter, 140 characters is not enough.**
87
-
88
80
  Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
89
- See the [Sidekiq support page](http://sidekiq.org/support) for details.
81
+ See the [Sidekiq support page](https://sidekiq.org/support.html) for details.
90
82
 
91
- Thanks
83
+ Contributing
92
84
  -----------------
93
85
 
94
- Sidekiq stays fast by using the [JProfiler java profiler](http://www.ej-technologies.com/products/jprofiler/overview.html) to find and fix
95
- 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).
96
87
 
97
88
 
98
89
  License
99
90
  -----------------
100
91
 
101
- 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.
102
93
 
103
94
 
104
95
  Author
105
96
  -----------------
106
97
 
107
- 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)