sidekiq 6.0.0 → 6.5.7

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