sidekiq 6.4.1 → 7.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +307 -12
  3. data/README.md +43 -35
  4. data/bin/multi_queue_bench +268 -0
  5. data/bin/sidekiq +3 -8
  6. data/bin/sidekiqload +206 -114
  7. data/bin/sidekiqmon +3 -0
  8. data/lib/sidekiq/api.rb +356 -167
  9. data/lib/sidekiq/capsule.rb +127 -0
  10. data/lib/sidekiq/cli.rb +85 -89
  11. data/lib/sidekiq/client.rb +87 -59
  12. data/lib/sidekiq/component.rb +68 -0
  13. data/lib/sidekiq/config.rb +287 -0
  14. data/lib/sidekiq/deploy.rb +62 -0
  15. data/lib/sidekiq/embedded.rb +61 -0
  16. data/lib/sidekiq/fetch.rb +21 -22
  17. data/lib/sidekiq/job.rb +371 -10
  18. data/lib/sidekiq/job_logger.rb +2 -2
  19. data/lib/sidekiq/job_retry.rb +97 -58
  20. data/lib/sidekiq/job_util.rb +62 -20
  21. data/lib/sidekiq/launcher.rb +91 -83
  22. data/lib/sidekiq/logger.rb +6 -45
  23. data/lib/sidekiq/manager.rb +33 -32
  24. data/lib/sidekiq/metrics/query.rb +156 -0
  25. data/lib/sidekiq/metrics/shared.rb +95 -0
  26. data/lib/sidekiq/metrics/tracking.rb +140 -0
  27. data/lib/sidekiq/middleware/chain.rb +96 -51
  28. data/lib/sidekiq/middleware/current_attributes.rb +58 -20
  29. data/lib/sidekiq/middleware/i18n.rb +6 -4
  30. data/lib/sidekiq/middleware/modules.rb +21 -0
  31. data/lib/sidekiq/monitor.rb +17 -4
  32. data/lib/sidekiq/paginator.rb +11 -3
  33. data/lib/sidekiq/processor.rb +81 -80
  34. data/lib/sidekiq/rails.rb +21 -14
  35. data/lib/sidekiq/redis_client_adapter.rb +111 -0
  36. data/lib/sidekiq/redis_connection.rb +16 -85
  37. data/lib/sidekiq/ring_buffer.rb +29 -0
  38. data/lib/sidekiq/scheduled.rb +66 -38
  39. data/lib/sidekiq/testing/inline.rb +4 -4
  40. data/lib/sidekiq/testing.rb +67 -75
  41. data/lib/sidekiq/transaction_aware_client.rb +44 -0
  42. data/lib/sidekiq/version.rb +2 -1
  43. data/lib/sidekiq/web/action.rb +3 -3
  44. data/lib/sidekiq/web/application.rb +107 -10
  45. data/lib/sidekiq/web/csrf_protection.rb +8 -5
  46. data/lib/sidekiq/web/helpers.rb +65 -43
  47. data/lib/sidekiq/web.rb +19 -14
  48. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  49. data/lib/sidekiq.rb +84 -207
  50. data/sidekiq.gemspec +12 -10
  51. data/web/assets/javascripts/application.js +92 -26
  52. data/web/assets/javascripts/base-charts.js +106 -0
  53. data/web/assets/javascripts/chart.min.js +13 -0
  54. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  55. data/web/assets/javascripts/dashboard-charts.js +182 -0
  56. data/web/assets/javascripts/dashboard.js +10 -249
  57. data/web/assets/javascripts/metrics.js +298 -0
  58. data/web/assets/stylesheets/application-dark.css +4 -0
  59. data/web/assets/stylesheets/application-rtl.css +2 -91
  60. data/web/assets/stylesheets/application.css +75 -299
  61. data/web/locales/ar.yml +70 -70
  62. data/web/locales/cs.yml +62 -62
  63. data/web/locales/da.yml +60 -53
  64. data/web/locales/de.yml +65 -65
  65. data/web/locales/el.yml +43 -24
  66. data/web/locales/en.yml +84 -69
  67. data/web/locales/es.yml +68 -68
  68. data/web/locales/fa.yml +65 -65
  69. data/web/locales/fr.yml +81 -67
  70. data/web/locales/gd.yml +99 -0
  71. data/web/locales/he.yml +65 -64
  72. data/web/locales/hi.yml +59 -59
  73. data/web/locales/it.yml +53 -53
  74. data/web/locales/ja.yml +73 -68
  75. data/web/locales/ko.yml +52 -52
  76. data/web/locales/lt.yml +66 -66
  77. data/web/locales/nb.yml +61 -61
  78. data/web/locales/nl.yml +52 -52
  79. data/web/locales/pl.yml +45 -45
  80. data/web/locales/pt-br.yml +83 -55
  81. data/web/locales/pt.yml +51 -51
  82. data/web/locales/ru.yml +67 -66
  83. data/web/locales/sv.yml +53 -53
  84. data/web/locales/ta.yml +60 -60
  85. data/web/locales/uk.yml +62 -61
  86. data/web/locales/ur.yml +64 -64
  87. data/web/locales/vi.yml +67 -67
  88. data/web/locales/zh-cn.yml +43 -16
  89. data/web/locales/zh-tw.yml +42 -8
  90. data/web/views/_footer.erb +5 -2
  91. data/web/views/_job_info.erb +18 -2
  92. data/web/views/_metrics_period_select.erb +12 -0
  93. data/web/views/_nav.erb +1 -1
  94. data/web/views/_paging.erb +2 -0
  95. data/web/views/_poll_link.erb +1 -1
  96. data/web/views/_summary.erb +7 -7
  97. data/web/views/busy.erb +50 -34
  98. data/web/views/dashboard.erb +26 -4
  99. data/web/views/filtering.erb +7 -0
  100. data/web/views/metrics.erb +91 -0
  101. data/web/views/metrics_for_job.erb +59 -0
  102. data/web/views/morgue.erb +5 -9
  103. data/web/views/queue.erb +15 -15
  104. data/web/views/queues.erb +9 -3
  105. data/web/views/retries.erb +5 -9
  106. data/web/views/scheduled.erb +12 -13
  107. metadata +58 -27
  108. data/lib/sidekiq/delay.rb +0 -43
  109. data/lib/sidekiq/exception_handler.rb +0 -27
  110. data/lib/sidekiq/extensions/action_mailer.rb +0 -48
  111. data/lib/sidekiq/extensions/active_record.rb +0 -43
  112. data/lib/sidekiq/extensions/class_methods.rb +0 -43
  113. data/lib/sidekiq/extensions/generic_proxy.rb +0 -33
  114. data/lib/sidekiq/util.rb +0 -108
  115. data/lib/sidekiq/worker.rb +0 -362
  116. /data/{LICENSE → LICENSE.txt} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99c9e264c092b88ea726be158fafe5bbab91f82f4b5864dee406280622e98e4b
4
- data.tar.gz: acd72bd99929d7c9d129cb9662276cc5adb7214de07cd4fc8accf6b9d521994a
3
+ metadata.gz: 34d69bb09eb124a8fd4710af9972bdb6a0cd74429bc3e61cdccdae683a4a0203
4
+ data.tar.gz: 8a37c7f172e4efabb061f980a73547d7245585574133b07d159f0412e49dd362
5
5
  SHA512:
6
- metadata.gz: 622c25276c017302c1a9d144e9366043ba359b2c3b0c57d4e7baad8f9de2e9c9969a86c91acdbefcf736af92e297c4e1fbe2008aa41e0c1accadda77dd0724f5
7
- data.tar.gz: 7e64012a5368cb0158ecaa50cdea6447709a64dd3a2816b36a31e7f17d70fffff81bd8d317c0cc1f9a6317adcffad9c200c48f9ca4bf208afba819ff7a07738e
6
+ metadata.gz: dbb63070d419ad3d2b8192b2864ff4608288c00fe51c7e79e4a3faafd33665cce0c92ece38f9cd2a30ae4b7ff7e66debaf894198b054b88c5d0b5d5ee3790153
7
+ data.tar.gz: 8ba7a30ebdd19734a7cc64031a6eb63e4f317de0ae652bed324c272fd57f422186add097b38ab88aaa2a0a925de6b0845d18739691cbd9e9f2e90f3d79bb9e0a
data/Changes.md CHANGED
@@ -1,8 +1,296 @@
1
1
  # Sidekiq Changes
2
2
 
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)
3
+ [Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
4
4
 
5
- HEAD
5
+ 7.2.1
6
+ ----------
7
+
8
+ - Add `Sidekiq::Work` type which replaces the raw Hash as the third parameter in
9
+ `Sidekiq::WorkSet#each { |pid, tid, hash| ... }` [#6145]
10
+ - **DEPRECATED**: direct access to the attributes within the `hash` block parameter above.
11
+ The `Sidekiq::Work` instance contains accessor methods to get at the same data, e.g.
12
+ ```ruby
13
+ work["queue"] # Old
14
+ work.queue # New
15
+ ```
16
+ - Fix Ruby 3.3 warnings around `base64` gem [#6151, earlopain]
17
+
18
+ 7.2.0
19
+ ----------
20
+
21
+ - `sidekiq_retries_exhausted` can return `:discard` to avoid the deadset
22
+ and all death handlers [#6091]
23
+ - Metrics filtering by job class in Web UI [#5974]
24
+ - Better readability and formatting for numbers within the Web UI [#6080]
25
+ - Add explicit error if user code tries to nest test modes [#6078]
26
+ ```ruby
27
+ Sidekiq::Testing.inline! # global setting
28
+ Sidekiq::Testing.fake! do # override within block
29
+ # ok
30
+ Sidekiq::Testing.inline! do # can't override the override
31
+ # not ok, nested
32
+ end
33
+ end
34
+ ```
35
+ - **SECURITY** Forbid inline JavaScript execution in Web UI [#6074]
36
+ - Adjust redis-client adapter to avoid `method_missing` [#6083]
37
+ This can result in app code breaking if your app's Redis API usage was
38
+ depending on Sidekiq's adapter to correct invalid redis-client API usage.
39
+ One example:
40
+ ```ruby
41
+ # bad, not redis-client native
42
+ # Unsupported command argument type: TrueClass (TypeError)
43
+ Sidekiq.redis { |c| c.set("key", "value", nx: true, ex: 15) }
44
+ # good
45
+ Sidekiq.redis { |c| c.set("key", "value", "nx", "ex", 15) }
46
+ ```
47
+
48
+ 7.1.6
49
+ ----------
50
+
51
+ - The block forms of testing modes (inline, fake) are now thread-safe so you can have
52
+ a multithreaded test suite which uses different modes for different tests. [#6069]
53
+ - Fix breakage with non-Proc error handlers [#6065]
54
+
55
+ 7.1.5
56
+ ----------
57
+
58
+ - **FEATURE**: Job filtering within the Web UI. This feature has been open
59
+ sourced from Sidekiq Pro. [#6052]
60
+ - **API CHANGE** Error handlers now take three arguments `->(ex, context, config)`.
61
+ The previous calling convention will work until Sidekiq 8.0 but will print
62
+ out a deprecation warning. [#6051]
63
+ - Fix issue with the `batch_size` and `at` options in `S::Client.push_bulk` [#6040]
64
+ - Fix inline testing firing batch callbacks early [#6057]
65
+ - Use new log broadcast API in Rails 7.1 [#6054]
66
+ - Crash if user tries to use RESP2 `protocol: 2` [#6061]
67
+
68
+ 7.1.4
69
+ ----------
70
+
71
+ - Fix empty `retry_for` logic [#6035]
72
+
73
+ 7.1.3
74
+ ----------
75
+
76
+ - Add `sidekiq_options retry_for: 48.hours` to allow time-based retry windows [#6029]
77
+ - Support sidekiq_retry_in and sidekiq_retries_exhausted_block in ActiveJobs (#5994)
78
+ - Lowercase all Rack headers for Rack 3.0 [#5951]
79
+ - Validate Sidekiq::Web page refresh delay to avoid potential DoS,
80
+ CVE-2023-26141, thanks for reporting Keegan!
81
+
82
+ 7.1.2
83
+ ----------
84
+
85
+ - Mark Web UI assets as private so CDNs won't cache them [#5936]
86
+ - Fix stackoverflow when using Oj and the JSON log formatter [#5920]
87
+ - Remove spurious `enqueued_at` from scheduled ActiveJobs [#5937]
88
+
89
+ 7.1.1
90
+ ----------
91
+
92
+ - Support multiple CurrentAttributes [#5904]
93
+ - Speed up latency fetch with large queues on Redis <7 [#5910]
94
+ - Allow a larger default client pool [#5886]
95
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
96
+
97
+ 7.1.0
98
+ ----------
99
+
100
+ - Improve display of ActiveJob arguments in Web UI [#5825, cover]
101
+ - Update `push_bulk` to push `batch_size` jobs at a time and allow laziness [#5827, fatkodima]
102
+ This allows Sidekiq::Client to push unlimited jobs as long as it has enough memory for the batch_size.
103
+ - Update `perform_bulk` to use `push_bulk` internally.
104
+ - Change return value of `push_bulk` to map 1-to-1 with arguments.
105
+ If you call `push_bulk(args: [[1], [2], [3]])`, you will now always get
106
+ an array of 3 values as the result: `["jid1", nil, "jid3"]` where nil means
107
+ that particular job did not push successfully (possibly due to middleware
108
+ stopping it). Previously nil values were removed so it was impossible to tell
109
+ which jobs pushed successfully and which did not.
110
+ - Migrate away from all deprecated Redis commands [#5788]
111
+ Sidekiq will now print a warning if you use one of those deprecated commands.
112
+ - Prefix all Sidekiq thread names [#5872]
113
+
114
+ 7.0.9
115
+ ----------
116
+
117
+ - Restore confirmation dialogs in Web UI [#5881, shevaun]
118
+ - Increase fetch timeout to minimize ReadTimeoutError [#5874]
119
+ - Reverse histogram tooltip ordering [#5868]
120
+ - Add Scottish Gaelic (gd) locale [#5867, GunChleoc]
121
+
122
+ 7.0.8
123
+ ----------
124
+
125
+ - **SECURITY** Sanitize `period` input parameter on Metrics pages.
126
+ Specially crafted values can lead to XSS. This functionality
127
+ was introduced in 7.0.4. Thank you to spercex @ huntr.dev [#5694]
128
+ - Add job hash as 3rd parameter to the `sidekiq_retry_in` block.
129
+
130
+ 7.0.7
131
+ ----------
132
+
133
+ - Fix redis-client API usage which could result in stuck Redis
134
+ connections [#5823]
135
+ - Fix AS::Duration with `sidekiq_retry_in` [#5806]
136
+ - Restore dumping config options on startup with `-v` [#5822]
137
+
138
+ 7.0.5,7.0.6
139
+ ----------
140
+
141
+ - More context for debugging json unsafe errors [#5787]
142
+
143
+ 7.0.4
144
+ ----------
145
+
146
+ - Performance and memory optimizations [#5768, fatkodima]
147
+ - Add 1-8 hour period selector to Metrics pages [#5694]
148
+ - Fix process display with `sidekiqmon` [#5733]
149
+
150
+ 7.0.3
151
+ ----------
152
+
153
+ - Don't warn about memory policy on Redis Enterprise [#5712]
154
+ - Don't allow Quiet/Stop on embedded Sidekiq instances [#5716]
155
+ - Fix `size: X` for configuring the default Redis pool size [#5702]
156
+ - Improve the display of queue weights on Busy page [#5642]
157
+ - Freeze CurrentAttributes on a job once initially set [#5692]
158
+
159
+ 7.0.2
160
+ ----------
161
+
162
+ - Improve compatibility with custom loggers [#5673]
163
+ - Add queue weights on Busy page [#5640]
164
+ - Add BID link on job_info page if job is part of a Batch [#5623]
165
+ - Allow custom extensions to add rows/links within Job detail pages [#5624]
166
+ ```ruby
167
+ Sidekiq::Web.custom_job_info_rows << AddAccountLink.new
168
+
169
+ class AddAccountLink
170
+ include CGI::Util
171
+ def add_pair(job)
172
+ # yield a (name, value) pair
173
+ # You can include HTML tags and CSS, Sidekiq does not do any
174
+ # escaping so beware user data injection! Note how we use CGI's
175
+ # `h` escape helper.
176
+ aid = job["account_id"]
177
+ yield "Account", "<a href='/accounts/#{h aid}'>#{h aid}</a>" if aid
178
+ end
179
+ end
180
+ ```
181
+
182
+ 7.0.1
183
+ ----------
184
+
185
+ - Allow an embedding process to reuse its own heartbeat thread
186
+ - Update zh-cn localization
187
+
188
+ 7.0.0
189
+ ----------
190
+
191
+ - Embedded mode!
192
+ - Capsules!!
193
+ - Job Execution metrics!!!
194
+ - See `docs/7.0-Upgrade.md` for release notes
195
+
196
+ 6.5.{10,11,12}
197
+ ----------
198
+
199
+ - Fixes for Rails 7.1 [#6067, #6070]
200
+
201
+ 6.5.9
202
+ ----------
203
+
204
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
205
+
206
+ 6.5.8
207
+ ----------
208
+
209
+ - Fail if using a bad version of scout_apm [#5616]
210
+ - Add pagination to Busy page [#5556]
211
+ - Speed up WorkSet#each [#5559]
212
+ - Adjust CurrentAttributes to work with the String class name so we aren't referencing the Class within a Rails initializer [#5536]
213
+
214
+ 6.5.7
215
+ ----------
216
+
217
+ - Updates for JA and ZH locales
218
+ - Further optimizations for scheduled polling [#5513]
219
+
220
+ 6.5.6
221
+ ----------
222
+
223
+ - Fix deprecation warnings with redis-rb 4.8.0 [#5484]
224
+ - Lock redis-rb to < 5.0 as we are moving to redis-client in Sidekiq 7.0
225
+
226
+ 6.5.5
227
+ ----------
228
+
229
+ - Fix require issue with job_retry.rb [#5462]
230
+ - Improve Sidekiq::Web compatibility with Rack 3.x
231
+
232
+ 6.5.4
233
+ ----------
234
+
235
+ - Fix invalid code on Ruby 2.5 [#5460]
236
+ - Fix further metrics dependency issues [#5457]
237
+
238
+ 6.5.3
239
+ ----------
240
+
241
+ - Don't require metrics code without explicit opt-in [#5456]
242
+
243
+ 6.5.2
244
+ ----------
245
+
246
+ - [Job Metrics are under active development, help wanted!](https://github.com/sidekiq/sidekiq/wiki/Metrics#contributing) **BETA**
247
+ - Add `Context` column on queue page which shows any CurrentAttributes [#5450]
248
+ - `sidekiq_retry_in` may now return `:discard` or `:kill` to dynamically stop job retries [#5406]
249
+ - Smarter sorting of processes in /busy Web UI [#5398]
250
+ - Fix broken hamburger menu in mobile UI [#5428]
251
+ - Require redis-rb 4.5.0. Note that Sidekiq will break if you use the
252
+ [`Redis.exists_returns_integer = false`](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#450) flag. [#5394]
253
+
254
+ 6.5.1
255
+ ----------
256
+
257
+ - Fix `push_bulk` breakage [#5387]
258
+
259
+ 6.5.0
260
+ ---------
261
+
262
+ - Substantial refactoring of Sidekiq server internals, part of a larger effort
263
+ 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).
264
+ - **Add beta support for the `redis-client` gem**. This will become the default Redis driver in Sidekiq 7.0. [#5298]
265
+ Read more: https://github.com/sidekiq/sidekiq/wiki/Using-redis-client
266
+ - **Add beta support for DB transaction-aware client** [#5291]
267
+ Add this line to your initializer and any jobs created during a transaction
268
+ will only be pushed to Redis **after the transaction commits**. You will need to add the
269
+ `after_commit_everywhere` gem to your Gemfile.
270
+ ```ruby
271
+ Sidekiq.transactional_push!
272
+ ```
273
+ This feature does not have a lot of production usage yet; please try it out and let us
274
+ know if you have any issues. It will be fully supported in Sidekiq 7.0 or removed if it
275
+ proves problematic.
276
+ - Fix regression with middleware arguments [#5312]
277
+
278
+ 6.4.2
279
+ ---------
280
+
281
+ - Strict argument checking now runs after client-side middleware [#5246]
282
+ - Fix page events with live polling [#5184]
283
+ - Many under-the-hood changes to remove all usage of the term "worker"
284
+ from the Sidekiq codebase and APIs. This mostly involved RDoc and local
285
+ variable names but a few constants and public APIs were changed. The old
286
+ APIs will be removed in Sidekiq 7.0.
287
+ ```
288
+ Sidekiq::DEFAULT_WORKER_OPTIONS -> Sidekiq.default_job_options
289
+ Sidekiq.default_worker_options -> Sidekiq.default_job_options
290
+ Sidekiq::Queues["default"].jobs_by_worker(HardJob) -> Sidekiq::Queues["default"].jobs_by_class(HardJob)
291
+ ```
292
+
293
+ 6.4.1
6
294
  ---------
7
295
 
8
296
  - Fix pipeline/multi deprecations in redis-rb 4.6
@@ -174,7 +462,7 @@ If this is a Rails app in API mode, you need to enable sessions.
174
462
  ---------
175
463
 
176
464
  - **Integrate with systemd's watchdog and notification features** [#4488]
177
- Set `Type=notify` in [sidekiq.service](https://github.com/mperham/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
465
+ Set `Type=notify` in [sidekiq.service](https://github.com/sidekiq/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
178
466
  - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
179
467
  - Fix edge case where a job can be pushed without a queue.
180
468
  - Flush job stats at exit [#4498]
@@ -187,7 +475,7 @@ If this is a Rails app in API mode, you need to enable sessions.
187
475
  - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
188
476
  - Update APIs to use `UNLINK`, not `DEL`. [#4449]
189
477
  - Fix Ruby 2.7 warnings [#4412]
190
- - Add support for `APP_ENV` [[95fa5d9]](https://github.com/mperham/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
478
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/sidekiq/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
191
479
 
192
480
  6.0.4
193
481
  ---------
@@ -299,7 +587,7 @@ Sidekiq.configure_server do |config|
299
587
  config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
300
588
  end
301
589
  ```
302
- See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for more details.
590
+ See the [Logging wiki page](https://github.com/sidekiq/sidekiq/wiki/Logging) for more details.
303
591
  - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
304
592
  variable. This variable is meant to hold the name of the environment
305
593
  variable which contains your Redis URL, so that you can switch Redis
@@ -319,6 +607,13 @@ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for
319
607
  - Integrate the StandardRB code formatter to ensure consistent code
320
608
  styling. [#4114, gearnode]
321
609
 
610
+ 5.2.10
611
+ ---------
612
+
613
+ - Backport fix for CVE-2022-23837.
614
+ - Migrate to `exists?` for redis-rb.
615
+ - Lock redis-rb to <4.6 to avoid deprecations.
616
+
322
617
  5.2.9
323
618
  ---------
324
619
 
@@ -484,7 +779,7 @@ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
484
779
  - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
485
780
  - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
486
781
  of random hex bytes.
487
- - Please see the [5.0 Upgrade notes](5.0-Upgrade.md) for more detail.
782
+ - Please see the [5.0 Upgrade notes](docs/5.0-Upgrade.md) for more detail.
488
783
 
489
784
  4.2.10
490
785
  -----------
@@ -702,7 +997,7 @@ Sidekiq::Queues.clear_all
702
997
  - Sidekiq's internals have been completely overhauled for performance
703
998
  and to remove dependencies. This has resulted in major speedups, as
704
999
  [detailed on my blog](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
705
- - See the [4.0 upgrade notes](4.0-Upgrade.md) for more detail.
1000
+ - See the [4.0 upgrade notes](docs/4.0-Upgrade.md) for more detail.
706
1001
 
707
1002
  3.5.4
708
1003
  -----------
@@ -739,7 +1034,7 @@ Sidekiq::Queues.clear_all
739
1034
  - **FIX MEMORY LEAK** Under rare conditions, threads may leak [#2598, gazay]
740
1035
  - Add Ukrainian locale [#2561, elrakita]
741
1036
  - Disconnect and retry Redis operations if we see a READONLY error [#2550]
742
- - Add server middleware testing harness; see [wiki](https://github.com/mperham/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
1037
+ - Add server middleware testing harness; see [wiki](https://github.com/sidekiq/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
743
1038
 
744
1039
  3.5.0
745
1040
  -----------
@@ -757,7 +1052,7 @@ Sidekiq::Queues.clear_all
757
1052
  - Fix CSRF vulnerability in Web UI, thanks to Egor Homakov for
758
1053
  reporting. [#2422] If you are running the Web UI as a standalone Rack app,
759
1054
  ensure you have a [session middleware
760
- configured](https://github.com/mperham/sidekiq/wiki/Monitoring#standalone):
1055
+ configured](https://github.com/sidekiq/sidekiq/wiki/Monitoring#standalone):
761
1056
  ```ruby
762
1057
  use Rack::Session::Cookie, :secret => "some unique secret string here"
763
1058
  ```
@@ -969,7 +1264,7 @@ sidekiq_options :dead => false, :retry => 5
969
1264
  3.0.0
970
1265
  -----------
971
1266
 
972
- Please see [3.0-Upgrade.md](3.0-Upgrade.md) for more comprehensive upgrade notes.
1267
+ Please see [3.0-Upgrade.md](docs/3.0-Upgrade.md) for more comprehensive upgrade notes.
973
1268
 
974
1269
  - **Dead Job Queue** - jobs which run out of retries are now moved to a dead
975
1270
  job queue. These jobs must be retried manually or they will expire
@@ -1013,7 +1308,7 @@ Sidekiq::Client.via(ConnectionPool.new { Redis.new }) do
1013
1308
  end
1014
1309
  ```
1015
1310
  **Sharding support does require a breaking change to client-side
1016
- middleware, see 3.0-Upgrade.md.**
1311
+ middleware, see docs/3.0-Upgrade.md.**
1017
1312
  - New Chinese, Greek, Swedish and Czech translations for the Web UI.
1018
1313
  - Updated most languages translations for the new UI features.
1019
1314
  - **Remove official Capistrano integration** - this integration has been
@@ -1141,7 +1436,7 @@ middleware, see 3.0-Upgrade.md.**
1141
1436
  appear to be doing any work. [#1194]
1142
1437
  - Sidekiq's testing behavior is now dynamic. You can choose between
1143
1438
  `inline` and `fake` behavior in your tests. See
1144
- [Testing](https://github.com/mperham/sidekiq/wiki/Testing) for detail. [#1193]
1439
+ [Testing](https://github.com/sidekiq/sidekiq/wiki/Testing) for detail. [#1193]
1145
1440
  - The Retries table has a new column for the error message.
1146
1441
  - The Web UI topbar now contains the status and live poll button.
1147
1442
  - Orphaned worker records are now auto-vacuumed when you visit the
data/README.md CHANGED
@@ -2,7 +2,7 @@ Sidekiq
2
2
  ==============
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
5
- ![Build](https://github.com/mperham/sidekiq/workflows/CI/badge.svg)
5
+ ![Build](https://github.com/sidekiq/sidekiq/workflows/CI/badge.svg)
6
6
 
7
7
  Simple, efficient background processing for Ruby.
8
8
 
@@ -10,89 +10,97 @@ Sidekiq uses threads to handle many jobs at the same time in the
10
10
  same process. It does not require Rails but will integrate tightly with
11
11
  Rails to make background processing dead simple.
12
12
 
13
- Performance
14
- ---------------
15
-
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 |
24
-
25
- This benchmark can be found in `bin/sidekiqload` and assumes a Redis network latency of 1ms.
26
13
 
27
14
  Requirements
28
15
  -----------------
29
16
 
30
- - Redis: 4.0+
31
- - Ruby: MRI 2.5+ or JRuby 9.2+.
17
+ - Redis: 6.2+
18
+ - Ruby: MRI 2.7+ or JRuby 9.3+.
32
19
 
33
- Sidekiq 6.0 supports Rails 5.0+ but does not require it.
20
+ Sidekiq 7.0 supports Rails 6.0+ but does not require it.
34
21
 
35
22
 
36
23
  Installation
37
24
  -----------------
38
25
 
39
- gem install sidekiq
26
+ bundle add sidekiq
40
27
 
41
28
 
42
29
  Getting Started
43
30
  -----------------
44
31
 
45
- See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
32
+ See the [Getting Started wiki page](https://github.com/sidekiq/sidekiq/wiki/Getting-Started) and follow the simple setup process.
46
33
  You can watch [this YouTube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
47
34
  Sidekiq and see its features in action. Here's the Web UI:
48
35
 
49
- ![Web UI](https://github.com/mperham/sidekiq/raw/main/examples/web-ui.png)
36
+ ![Web UI](https://github.com/sidekiq/sidekiq/raw/main/examples/web-ui.png)
37
+
38
+ Performance
39
+ ---------------
50
40
 
41
+ The benchmark in `bin/sidekiqload` creates 500,000 no-op jobs and drains them as fast as possible, assuming a fixed Redis network latency of 1ms.
42
+ This requires a lot of Redis network I/O and JSON parsing.
43
+ This benchmark is IO-bound so we increase the concurrency to 25.
44
+ If your application is sending lots of emails or performing other network-intensive work, you could see a similar benefit but be careful not to saturate the CPU.
45
+
46
+ Version | Time to process 500k jobs | Throughput (jobs/sec) | Ruby | Concurrency | Job Type
47
+ -----------------|------|---------|---------|------------------------|---
48
+ Sidekiq 7.0.3 | 21.3 sec| 23,500 | 3.2.0+yjit | 30 | Sidekiq::Job
49
+ Sidekiq 7.0.3 | 33.8 sec| 14,700 | 3.2.0+yjit | 30 | ActiveJob 7.0.4
50
+ Sidekiq 7.0.3 | 23.5 sec| 21,300 | 3.2.0 | 30 | Sidekiq::Job
51
+ Sidekiq 7.0.3 | 46.5 sec| 10,700 | 3.2.0 | 30 | ActiveJob 7.0.4
52
+ Sidekiq 7.0.3 | 23.0 sec| 21,700 | 2.7.5 | 30 | Sidekiq::Job
53
+ Sidekiq 7.0.3 | 46.5 sec| 10,850 | 2.7.5 | 30 | ActiveJob 7.0.4
54
+
55
+ Most of Sidekiq's overhead is Redis network I/O.
56
+ ActiveJob adds a notable amount of CPU overhead due to argument deserialization and callbacks.
57
+ Concurrency of 30 was determined experimentally to maximize one CPU without saturating it.
51
58
 
52
59
  Want to Upgrade?
53
60
  -------------------
54
61
 
62
+ Use `bundle up sidekiq` to upgrade Sidekiq and all its dependencies.
63
+ Upgrade notes between each major version can be found in the `docs/` directory.
64
+
55
65
  I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
56
66
  features, a commercial-friendly license and allow you to support high
57
67
  quality open source development all at the same time. Please see the
58
68
  [Sidekiq](https://sidekiq.org/) homepage for more detail.
59
69
 
60
- Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
61
- features and changes to Sidekiq and its bigger siblings.
62
-
63
70
 
64
71
  Problems?
65
72
  -----------------
66
73
 
67
- **Please do not directly email any Sidekiq committers with questions or problems.** A community is best served when discussions are held in public.
74
+ **Please do not directly email any Sidekiq committers with questions or problems.**
75
+ A community is best served when discussions are held in public.
68
76
 
69
- If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
70
- Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
77
+ If you have a problem, please review the [FAQ](https://github.com/sidekiq/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/sidekiq/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
78
+ Searching the [issues](https://github.com/sidekiq/sidekiq/issues) for your problem is also a good idea.
71
79
 
72
- Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at https://sidekiq.org; email support@contribsys.com for help.
80
+ Sidekiq Pro and Sidekiq Enterprise customers get private email support.
81
+ You can purchase at https://sidekiq.org; email support@contribsys.com for help.
73
82
 
74
83
  Useful resources:
75
84
 
76
- * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
77
- * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
85
+ * Product documentation is in the [wiki](https://github.com/sidekiq/sidekiq/wiki).
86
+ * Occasional announcements are made to the [@sidekiq](https://ruby.social/@sidekiq) Mastodon account.
78
87
  * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q &amp; A.
79
88
 
80
- Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
89
+ Every Friday morning is Sidekiq office hour: I video chat and answer questions.
81
90
  See the [Sidekiq support page](https://sidekiq.org/support.html) for details.
82
91
 
83
92
  Contributing
84
93
  -----------------
85
94
 
86
- Please see [the contributing guidelines](https://github.com/mperham/sidekiq/blob/main/.github/contributing.md).
87
-
95
+ Please see [the contributing guidelines](https://github.com/sidekiq/sidekiq/blob/main/.github/contributing.md).
88
96
 
89
97
  License
90
98
  -----------------
91
99
 
92
- Please see [LICENSE](https://github.com/mperham/sidekiq/blob/main/LICENSE) for licensing details.
93
-
100
+ Please see [LICENSE.txt](https://github.com/sidekiq/sidekiq/blob/main/LICENSE.txt) for licensing details.
101
+ The license for Sidekiq Pro and Sidekiq Enterprise can be found in [COMM-LICENSE.txt](https://github.com/sidekiq/sidekiq/blob/main/COMM-LICENSE.txt).
94
102
 
95
103
  Author
96
104
  -----------------
97
105
 
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)
106
+ Mike Perham, [@getajobmike](https://ruby.social/@getajobmike) / [@sidekiq](https://ruby.social/@sidekiq), [https://www.mikeperham.com](https://www.mikeperham.com) / [https://www.contribsys.com](https://www.contribsys.com)