sidekiq 5.1.1 → 6.5.9

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