sidekiq 5.2.10 → 6.5.12

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