sidekiq 6.2.2 → 7.1.0

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +279 -11
  3. data/LICENSE.txt +9 -0
  4. data/README.md +45 -32
  5. data/bin/sidekiq +4 -9
  6. data/bin/sidekiqload +207 -117
  7. data/bin/sidekiqmon +4 -1
  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 +331 -187
  13. data/lib/sidekiq/capsule.rb +127 -0
  14. data/lib/sidekiq/cli.rb +94 -81
  15. data/lib/sidekiq/client.rb +100 -96
  16. data/lib/sidekiq/{util.rb → component.rb} +14 -41
  17. data/lib/sidekiq/config.rb +274 -0
  18. data/lib/sidekiq/deploy.rb +62 -0
  19. data/lib/sidekiq/embedded.rb +61 -0
  20. data/lib/sidekiq/fetch.rb +26 -26
  21. data/lib/sidekiq/job.rb +371 -5
  22. data/lib/sidekiq/job_logger.rb +16 -28
  23. data/lib/sidekiq/job_retry.rb +85 -59
  24. data/lib/sidekiq/job_util.rb +105 -0
  25. data/lib/sidekiq/launcher.rb +106 -94
  26. data/lib/sidekiq/logger.rb +9 -44
  27. data/lib/sidekiq/manager.rb +40 -41
  28. data/lib/sidekiq/metrics/query.rb +153 -0
  29. data/lib/sidekiq/metrics/shared.rb +95 -0
  30. data/lib/sidekiq/metrics/tracking.rb +136 -0
  31. data/lib/sidekiq/middleware/chain.rb +96 -51
  32. data/lib/sidekiq/middleware/current_attributes.rb +56 -0
  33. data/lib/sidekiq/middleware/i18n.rb +6 -4
  34. data/lib/sidekiq/middleware/modules.rb +21 -0
  35. data/lib/sidekiq/monitor.rb +17 -4
  36. data/lib/sidekiq/paginator.rb +17 -9
  37. data/lib/sidekiq/processor.rb +60 -60
  38. data/lib/sidekiq/rails.rb +25 -6
  39. data/lib/sidekiq/redis_client_adapter.rb +96 -0
  40. data/lib/sidekiq/redis_connection.rb +17 -88
  41. data/lib/sidekiq/ring_buffer.rb +29 -0
  42. data/lib/sidekiq/scheduled.rb +101 -44
  43. data/lib/sidekiq/testing/inline.rb +4 -4
  44. data/lib/sidekiq/testing.rb +41 -68
  45. data/lib/sidekiq/transaction_aware_client.rb +44 -0
  46. data/lib/sidekiq/version.rb +2 -1
  47. data/lib/sidekiq/web/action.rb +3 -3
  48. data/lib/sidekiq/web/application.rb +47 -13
  49. data/lib/sidekiq/web/csrf_protection.rb +3 -3
  50. data/lib/sidekiq/web/helpers.rb +36 -33
  51. data/lib/sidekiq/web.rb +10 -17
  52. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  53. data/lib/sidekiq.rb +86 -201
  54. data/sidekiq.gemspec +12 -10
  55. data/web/assets/javascripts/application.js +131 -60
  56. data/web/assets/javascripts/base-charts.js +106 -0
  57. data/web/assets/javascripts/chart.min.js +13 -0
  58. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  59. data/web/assets/javascripts/dashboard-charts.js +166 -0
  60. data/web/assets/javascripts/dashboard.js +36 -273
  61. data/web/assets/javascripts/metrics.js +264 -0
  62. data/web/assets/stylesheets/application-dark.css +23 -23
  63. data/web/assets/stylesheets/application-rtl.css +2 -95
  64. data/web/assets/stylesheets/application.css +73 -402
  65. data/web/locales/ar.yml +70 -70
  66. data/web/locales/cs.yml +62 -62
  67. data/web/locales/da.yml +60 -53
  68. data/web/locales/de.yml +65 -65
  69. data/web/locales/el.yml +43 -24
  70. data/web/locales/en.yml +82 -69
  71. data/web/locales/es.yml +68 -68
  72. data/web/locales/fa.yml +65 -65
  73. data/web/locales/fr.yml +81 -67
  74. data/web/locales/gd.yml +99 -0
  75. data/web/locales/he.yml +65 -64
  76. data/web/locales/hi.yml +59 -59
  77. data/web/locales/it.yml +53 -53
  78. data/web/locales/ja.yml +73 -68
  79. data/web/locales/ko.yml +52 -52
  80. data/web/locales/lt.yml +66 -66
  81. data/web/locales/nb.yml +61 -61
  82. data/web/locales/nl.yml +52 -52
  83. data/web/locales/pl.yml +45 -45
  84. data/web/locales/pt-br.yml +63 -55
  85. data/web/locales/pt.yml +51 -51
  86. data/web/locales/ru.yml +67 -66
  87. data/web/locales/sv.yml +53 -53
  88. data/web/locales/ta.yml +60 -60
  89. data/web/locales/uk.yml +62 -61
  90. data/web/locales/ur.yml +64 -64
  91. data/web/locales/vi.yml +67 -67
  92. data/web/locales/zh-cn.yml +43 -16
  93. data/web/locales/zh-tw.yml +42 -8
  94. data/web/views/_footer.erb +6 -3
  95. data/web/views/_job_info.erb +18 -2
  96. data/web/views/_metrics_period_select.erb +12 -0
  97. data/web/views/_nav.erb +1 -1
  98. data/web/views/_paging.erb +2 -0
  99. data/web/views/_poll_link.erb +3 -6
  100. data/web/views/_summary.erb +7 -7
  101. data/web/views/busy.erb +44 -28
  102. data/web/views/dashboard.erb +44 -12
  103. data/web/views/layout.erb +1 -1
  104. data/web/views/metrics.erb +82 -0
  105. data/web/views/metrics_for_job.erb +68 -0
  106. data/web/views/morgue.erb +5 -9
  107. data/web/views/queue.erb +24 -24
  108. data/web/views/queues.erb +4 -2
  109. data/web/views/retries.erb +5 -9
  110. data/web/views/scheduled.erb +12 -13
  111. metadata +62 -31
  112. data/LICENSE +0 -9
  113. data/lib/generators/sidekiq/worker_generator.rb +0 -57
  114. data/lib/sidekiq/delay.rb +0 -41
  115. data/lib/sidekiq/exception_handler.rb +0 -27
  116. data/lib/sidekiq/extensions/action_mailer.rb +0 -48
  117. data/lib/sidekiq/extensions/active_record.rb +0 -43
  118. data/lib/sidekiq/extensions/class_methods.rb +0 -43
  119. data/lib/sidekiq/extensions/generic_proxy.rb +0 -33
  120. data/lib/sidekiq/worker.rb +0 -244
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b0da541124d097e05936cc860a93009ba170d714cbd8dbc760c1245818e8ed7
4
- data.tar.gz: 63995ccbb57fa16e4954cda4ab9610506b0a8ff35084492b520fc18608face35
3
+ metadata.gz: e35d1e6eac7b96128e63d16ffaa1e1b435edd2d1af2e9ba9eb41e7b548ecafdd
4
+ data.tar.gz: 24717c4bdef48d83ee1467f97a216f023937b2a69a5db726614b78ea054a9699
5
5
  SHA512:
6
- metadata.gz: f3b864db74530840437c0af43475ed0e12a876d6d2cbbd808ecc72722adddbd8d5548c9b777d4e34af5deddf94871567717518f70d787ea7f6a089f2f5b2f4ed
7
- data.tar.gz: 4569eed5baa10134e99a0b1404c213e3b35c08ec158e2fa8b006918298750919e8d34074aa10d3b4dfb621bb18cbe68be467d1e7822fb855012cff0f64dcdc7b
6
+ metadata.gz: 70d4e5e58853a86ee8761c6c766daac03333fd7752c4102db8caca0e1631d7d37377acb3fe2e616497d02e067fbee2577ccdf0b5497cb95ae0ce5414232bac25
7
+ data.tar.gz: 628c9516bd22b09e2b431f917f3218200c137dd36534e9742c41b916e3994b609aecf119e9e0c8caf359ad8b30b2a95974d507e6e99a6e330f5651a4af4142ab
data/Changes.md CHANGED
@@ -1,6 +1,267 @@
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/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
+
5
+ 7.1.0
6
+ ----------
7
+
8
+ - Improve display of ActiveJob arguments in Web UI [#5825, cover]
9
+ - Update `push_bulk` to push `batch_size` jobs at a time and allow laziness [#5827, fatkodima]
10
+ This allows Sidekiq::Client to push unlimited jobs as long as it has enough memory for the batch_size.
11
+ - Update `perform_bulk` to use `push_bulk` internally.
12
+ - Change return value of `push_bulk` to map 1-to-1 with arguments.
13
+ If you call `push_bulk(args: [[1], [2], [3]])`, you will now always get
14
+ an array of 3 values as the result: `["jid1", nil, "jid3"]` where nil means
15
+ that particular job did not push successfully (possibly due to middleware
16
+ stopping it). Previously nil values were removed so it was impossible to tell
17
+ which jobs pushed successfully and which did not.
18
+ - Migrate away from all deprecated Redis commands [#5788]
19
+ Sidekiq will now print a warning if you use one of those deprecated commands.
20
+ - Prefix all Sidekiq thread names [#5872]
21
+
22
+ 7.0.9
23
+ ----------
24
+
25
+ - Restore confirmation dialogs in Web UI [#5881, shevaun]
26
+ - Increase fetch timeout to minimize ReadTimeoutError [#5874]
27
+ - Reverse histogram tooltip ordering [#5868]
28
+ - Add Scottish Gaelic (gd) locale [#5867, GunChleoc]
29
+
30
+ 7.0.8
31
+ ----------
32
+
33
+ - **SECURITY** Sanitize `period` input parameter on Metrics pages.
34
+ Specially crafted values can lead to XSS. This functionality
35
+ was introduced in 7.0.4. Thank you to spercex @ huntr.dev [#5694]
36
+ - Add job hash as 3rd parameter to the `sidekiq_retry_in` block.
37
+
38
+ 7.0.7
39
+ ----------
40
+
41
+ - Fix redis-client API usage which could result in stuck Redis
42
+ connections [#5823]
43
+ - Fix AS::Duration with `sidekiq_retry_in` [#5806]
44
+ - Restore dumping config options on startup with `-v` [#5822]
45
+
46
+ 7.0.5,7.0.6
47
+ ----------
48
+
49
+ - More context for debugging json unsafe errors [#5787]
50
+
51
+ 7.0.4
52
+ ----------
53
+
54
+ - Performance and memory optimizations [#5768, fatkodima]
55
+ - Add 1-8 hour period selector to Metrics pages [#5694]
56
+ - Fix process display with `sidekiqmon` [#5733]
57
+
58
+ 7.0.3
59
+ ----------
60
+
61
+ - Don't warn about memory policy on Redis Enterprise [#5712]
62
+ - Don't allow Quiet/Stop on embedded Sidekiq instances [#5716]
63
+ - Fix `size: X` for configuring the default Redis pool size [#5702]
64
+ - Improve the display of queue weights on Busy page [#5642]
65
+ - Freeze CurrentAttributes on a job once initially set [#5692]
66
+
67
+ 7.0.2
68
+ ----------
69
+
70
+ - Improve compatibility with custom loggers [#5673]
71
+ - Add queue weights on Busy page [#5640]
72
+ - Add BID link on job_info page if job is part of a Batch [#5623]
73
+ - Allow custom extensions to add rows/links within Job detail pages [#5624]
74
+ ```ruby
75
+ Sidekiq::Web.custom_job_info_rows << AddAccountLink.new
76
+
77
+ class AddAccountLink
78
+ include CGI::Util
79
+ def add_pair(job)
80
+ # yield a (name, value) pair
81
+ # You can include HTML tags and CSS, Sidekiq does not do any
82
+ # escaping so beware user data injection! Note how we use CGI's
83
+ # `h` escape helper.
84
+ aid = job["account_id"]
85
+ yield "Account", "<a href='/accounts/#{h aid}'>#{h aid}</a>" if aid
86
+ end
87
+ end
88
+ ```
89
+
90
+ 7.0.1
91
+ ----------
92
+
93
+ - Allow an embedding process to reuse its own heartbeat thread
94
+ - Update zh-cn localization
95
+
96
+ 7.0.0
97
+ ----------
98
+
99
+ - Embedded mode!
100
+ - Capsules!!
101
+ - Job Execution metrics!!!
102
+ - See `docs/7.0-Upgrade.md` for release notes
103
+
104
+ 6.5.8
105
+ ----------
106
+
107
+ - Fail if using a bad version of scout_apm [#5616]
108
+ - Add pagination to Busy page [#5556]
109
+ - Speed up WorkSet#each [#5559]
110
+ - Adjust CurrentAttributes to work with the String class name so we aren't referencing the Class within a Rails initializer [#5536]
111
+
112
+ 6.5.7
113
+ ----------
114
+
115
+ - Updates for JA and ZH locales
116
+ - Further optimizations for scheduled polling [#5513]
117
+
118
+ 6.5.6
119
+ ----------
120
+
121
+ - Fix deprecation warnings with redis-rb 4.8.0 [#5484]
122
+ - Lock redis-rb to < 5.0 as we are moving to redis-client in Sidekiq 7.0
123
+
124
+ 6.5.5
125
+ ----------
126
+
127
+ - Fix require issue with job_retry.rb [#5462]
128
+ - Improve Sidekiq::Web compatibility with Rack 3.x
129
+
130
+ 6.5.4
131
+ ----------
132
+
133
+ - Fix invalid code on Ruby 2.5 [#5460]
134
+ - Fix further metrics dependency issues [#5457]
135
+
136
+ 6.5.3
137
+ ----------
138
+
139
+ - Don't require metrics code without explicit opt-in [#5456]
140
+
141
+ 6.5.2
142
+ ----------
143
+
144
+ - [Job Metrics are under active development, help wanted!](https://github.com/sidekiq/sidekiq/wiki/Metrics#contributing) **BETA**
145
+ - Add `Context` column on queue page which shows any CurrentAttributes [#5450]
146
+ - `sidekiq_retry_in` may now return `:discard` or `:kill` to dynamically stop job retries [#5406]
147
+ - Smarter sorting of processes in /busy Web UI [#5398]
148
+ - Fix broken hamburger menu in mobile UI [#5428]
149
+ - Require redis-rb 4.5.0. Note that Sidekiq will break if you use the
150
+ [`Redis.exists_returns_integer = false`](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#450) flag. [#5394]
151
+
152
+ 6.5.1
153
+ ----------
154
+
155
+ - Fix `push_bulk` breakage [#5387]
156
+
157
+ 6.5.0
158
+ ---------
159
+
160
+ - Substantial refactoring of Sidekiq server internals, part of a larger effort
161
+ 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).
162
+ - **Add beta support for the `redis-client` gem**. This will become the default Redis driver in Sidekiq 7.0. [#5298]
163
+ Read more: https://github.com/sidekiq/sidekiq/wiki/Using-redis-client
164
+ - **Add beta support for DB transaction-aware client** [#5291]
165
+ Add this line to your initializer and any jobs created during a transaction
166
+ will only be pushed to Redis **after the transaction commits**. You will need to add the
167
+ `after_commit_everywhere` gem to your Gemfile.
168
+ ```ruby
169
+ Sidekiq.transactional_push!
170
+ ```
171
+ This feature does not have a lot of production usage yet; please try it out and let us
172
+ know if you have any issues. It will be fully supported in Sidekiq 7.0 or removed if it
173
+ proves problematic.
174
+ - Fix regression with middleware arguments [#5312]
175
+
176
+ 6.4.2
177
+ ---------
178
+
179
+ - Strict argument checking now runs after client-side middleware [#5246]
180
+ - Fix page events with live polling [#5184]
181
+ - Many under-the-hood changes to remove all usage of the term "worker"
182
+ from the Sidekiq codebase and APIs. This mostly involved RDoc and local
183
+ variable names but a few constants and public APIs were changed. The old
184
+ APIs will be removed in Sidekiq 7.0.
185
+ ```
186
+ Sidekiq::DEFAULT_WORKER_OPTIONS -> Sidekiq.default_job_options
187
+ Sidekiq.default_worker_options -> Sidekiq.default_job_options
188
+ Sidekiq::Queues["default"].jobs_by_worker(HardJob) -> Sidekiq::Queues["default"].jobs_by_class(HardJob)
189
+ ```
190
+
191
+ 6.4.1
192
+ ---------
193
+
194
+ - Fix pipeline/multi deprecations in redis-rb 4.6
195
+ - Fix sidekiq.yml YAML load errors on Ruby 3.1 [#5141]
196
+ - Sharding support for `perform_bulk` [#5129]
197
+ - Refactor job logger for SPEEEEEEED
198
+
199
+ 6.4.0
200
+ ---------
201
+
202
+ - **SECURITY**: Validate input to avoid possible DoS in Web UI.
203
+ - Add **strict argument checking** [#5071]
204
+ Sidekiq will now log a warning if JSON-unsafe arguments are passed to `perform_async`.
205
+ Add `Sidekiq.strict_args!(false)` to your initializer to disable this warning.
206
+ This warning will switch to an exception in Sidekiq 7.0.
207
+ - Note that Delayed Extensions will be removed in Sidekiq 7.0 [#5076]
208
+ - Add `perform_{inline,sync}` in Sidekiq::Job to run a job synchronously [#5061, hasan-ally]
209
+ ```ruby
210
+ SomeJob.perform_async(args...)
211
+ SomeJob.perform_sync(args...)
212
+ SomeJob.perform_inline(args...)
213
+ ```
214
+ You can also dynamically redirect a job to run synchronously:
215
+ ```ruby
216
+ SomeJob.set("sync": true).perform_async(args...) # will run via perform_inline
217
+ ```
218
+ - Replace Sidekiq::Worker `app/workers` generator with Sidekiq::Job `app/sidekiq` generator [#5055]
219
+ ```
220
+ bin/rails generate sidekiq:job ProcessOrderJob
221
+ ```
222
+ - Fix job retries losing CurrentAttributes [#5090]
223
+ - Tweak shutdown to give long-running threads time to cleanup [#5095]
224
+
225
+ 6.3.1
226
+ ---------
227
+
228
+ - Fix keyword arguments error with CurrentAttributes on Ruby 3.0 [#5048]
229
+
230
+ 6.3.0
231
+ ---------
232
+
233
+ - **BREAK**: The Web UI has been refactored to remove jQuery. Any UI extensions
234
+ which use jQuery will break.
235
+ - **FEATURE**: Sidekiq.logger has been enhanced so any `Rails.logger`
236
+ output in jobs now shows up in the Sidekiq console. Remove any logger
237
+ hacks in your initializer and see if it Just Works™ now. [#5021]
238
+ - **FEATURE**: Add `Sidekiq::Job` alias for `Sidekiq::Worker`, to better
239
+ reflect industry standard terminology. You can now do this:
240
+ ```ruby
241
+ class MyJob
242
+ include Sidekiq::Job
243
+ sidekiq_options ...
244
+ def perform(args)
245
+ end
246
+ end
247
+ ```
248
+ - **FEATURE**: Support for serializing ActiveSupport::CurrentAttributes into each job. [#4982]
249
+ ```ruby
250
+ # config/initializers/sidekiq.rb
251
+ require "sidekiq/middleware/current_attributes"
252
+ Sidekiq::CurrentAttributes.persist(Myapp::Current) # Your AS::CurrentAttributes singleton
253
+ ```
254
+ - **FEATURE**: Add `Sidekiq::Worker.perform_bulk` for enqueuing jobs in bulk,
255
+ similar to `Sidekiq::Client.push_bulk` [#5042]
256
+ ```ruby
257
+ MyJob.perform_bulk([[1], [2], [3]])
258
+ ```
259
+ - Implement `queue_as`, `wait` and `wait_until` for ActiveJob compatibility [#5003]
260
+ - Scheduler now uses Lua to reduce Redis load and network roundtrips [#5044]
261
+ - Retry Redis operation if we get an `UNBLOCKED` Redis error [#4985]
262
+ - Run existing signal traps, if any, before running Sidekiq's trap [#4991]
263
+ - Fix fetch bug when using weighted queues which caused Sidekiq to stop
264
+ processing queues randomly [#5031]
4
265
 
5
266
  6.2.2
6
267
  ---------
@@ -99,7 +360,7 @@ If this is a Rails app in API mode, you need to enable sessions.
99
360
  ---------
100
361
 
101
362
  - **Integrate with systemd's watchdog and notification features** [#4488]
102
- Set `Type=notify` in [sidekiq.service](https://github.com/mperham/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
363
+ Set `Type=notify` in [sidekiq.service](https://github.com/sidekiq/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
103
364
  - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
104
365
  - Fix edge case where a job can be pushed without a queue.
105
366
  - Flush job stats at exit [#4498]
@@ -112,7 +373,7 @@ If this is a Rails app in API mode, you need to enable sessions.
112
373
  - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
113
374
  - Update APIs to use `UNLINK`, not `DEL`. [#4449]
114
375
  - Fix Ruby 2.7 warnings [#4412]
115
- - Add support for `APP_ENV` [[95fa5d9]](https://github.com/mperham/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
376
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/sidekiq/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
116
377
 
117
378
  6.0.4
118
379
  ---------
@@ -224,7 +485,7 @@ Sidekiq.configure_server do |config|
224
485
  config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
225
486
  end
226
487
  ```
227
- See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for more details.
488
+ See the [Logging wiki page](https://github.com/sidekiq/sidekiq/wiki/Logging) for more details.
228
489
  - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
229
490
  variable. This variable is meant to hold the name of the environment
230
491
  variable which contains your Redis URL, so that you can switch Redis
@@ -244,6 +505,13 @@ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for
244
505
  - Integrate the StandardRB code formatter to ensure consistent code
245
506
  styling. [#4114, gearnode]
246
507
 
508
+ 5.2.10
509
+ ---------
510
+
511
+ - Backport fix for CVE-2022-23837.
512
+ - Migrate to `exists?` for redis-rb.
513
+ - Lock redis-rb to <4.6 to avoid deprecations.
514
+
247
515
  5.2.9
248
516
  ---------
249
517
 
@@ -409,7 +677,7 @@ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
409
677
  - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
410
678
  - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
411
679
  of random hex bytes.
412
- - Please see the [5.0 Upgrade notes](5.0-Upgrade.md) for more detail.
680
+ - Please see the [5.0 Upgrade notes](docs/5.0-Upgrade.md) for more detail.
413
681
 
414
682
  4.2.10
415
683
  -----------
@@ -627,7 +895,7 @@ Sidekiq::Queues.clear_all
627
895
  - Sidekiq's internals have been completely overhauled for performance
628
896
  and to remove dependencies. This has resulted in major speedups, as
629
897
  [detailed on my blog](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
630
- - See the [4.0 upgrade notes](4.0-Upgrade.md) for more detail.
898
+ - See the [4.0 upgrade notes](docs/4.0-Upgrade.md) for more detail.
631
899
 
632
900
  3.5.4
633
901
  -----------
@@ -664,7 +932,7 @@ Sidekiq::Queues.clear_all
664
932
  - **FIX MEMORY LEAK** Under rare conditions, threads may leak [#2598, gazay]
665
933
  - Add Ukrainian locale [#2561, elrakita]
666
934
  - Disconnect and retry Redis operations if we see a READONLY error [#2550]
667
- - Add server middleware testing harness; see [wiki](https://github.com/mperham/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
935
+ - Add server middleware testing harness; see [wiki](https://github.com/sidekiq/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
668
936
 
669
937
  3.5.0
670
938
  -----------
@@ -682,7 +950,7 @@ Sidekiq::Queues.clear_all
682
950
  - Fix CSRF vulnerability in Web UI, thanks to Egor Homakov for
683
951
  reporting. [#2422] If you are running the Web UI as a standalone Rack app,
684
952
  ensure you have a [session middleware
685
- configured](https://github.com/mperham/sidekiq/wiki/Monitoring#standalone):
953
+ configured](https://github.com/sidekiq/sidekiq/wiki/Monitoring#standalone):
686
954
  ```ruby
687
955
  use Rack::Session::Cookie, :secret => "some unique secret string here"
688
956
  ```
@@ -894,7 +1162,7 @@ sidekiq_options :dead => false, :retry => 5
894
1162
  3.0.0
895
1163
  -----------
896
1164
 
897
- Please see [3.0-Upgrade.md](3.0-Upgrade.md) for more comprehensive upgrade notes.
1165
+ Please see [3.0-Upgrade.md](docs/3.0-Upgrade.md) for more comprehensive upgrade notes.
898
1166
 
899
1167
  - **Dead Job Queue** - jobs which run out of retries are now moved to a dead
900
1168
  job queue. These jobs must be retried manually or they will expire
@@ -938,7 +1206,7 @@ Sidekiq::Client.via(ConnectionPool.new { Redis.new }) do
938
1206
  end
939
1207
  ```
940
1208
  **Sharding support does require a breaking change to client-side
941
- middleware, see 3.0-Upgrade.md.**
1209
+ middleware, see docs/3.0-Upgrade.md.**
942
1210
  - New Chinese, Greek, Swedish and Czech translations for the Web UI.
943
1211
  - Updated most languages translations for the new UI features.
944
1212
  - **Remove official Capistrano integration** - this integration has been
@@ -1066,7 +1334,7 @@ middleware, see 3.0-Upgrade.md.**
1066
1334
  appear to be doing any work. [#1194]
1067
1335
  - Sidekiq's testing behavior is now dynamic. You can choose between
1068
1336
  `inline` and `fake` behavior in your tests. See
1069
- [Testing](https://github.com/mperham/sidekiq/wiki/Testing) for detail. [#1193]
1337
+ [Testing](https://github.com/sidekiq/sidekiq/wiki/Testing) for detail. [#1193]
1070
1338
  - The Retries table has a new column for the error message.
1071
1339
  - The Web UI topbar now contains the status and live poll button.
1072
1340
  - Orphaned worker records are now auto-vacuumed when you visit the
data/LICENSE.txt ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) Contributed Systems LLC
2
+
3
+ Sidekiq is an Open Source project licensed under the terms of
4
+ the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
+ for license text.
6
+
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,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,82 +10,95 @@ 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.
46
- You can watch [this Youtube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
32
+ See the [Getting Started wiki page](https://github.com/sidekiq/sidekiq/wiki/Getting-Started) and follow the simple setup process.
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/master/examples/web-ui.png)
36
+ ![Web UI](https://github.com/sidekiq/sidekiq/raw/main/examples/web-ui.png)
37
+
38
+ Performance
39
+ ---------------
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
50
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).
85
+ * Product documentation is in the [wiki](https://github.com/sidekiq/sidekiq/wiki).
77
86
  * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter 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
 
92
+ Contributing
93
+ -----------------
94
+
95
+ Please see [the contributing guidelines](https://github.com/sidekiq/sidekiq/blob/main/.github/contributing.md).
83
96
 
84
97
  License
85
98
  -----------------
86
99
 
87
- Please see [LICENSE](https://github.com/mperham/sidekiq/blob/master/LICENSE) for licensing details.
88
-
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).
89
102
 
90
103
  Author
91
104
  -----------------
data/bin/sidekiq CHANGED
@@ -4,13 +4,13 @@
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
8
 
9
9
  def integrate_with_systemd
10
10
  return unless ENV["NOTIFY_SOCKET"]
11
11
 
12
12
  Sidekiq.configure_server do |config|
13
- Sidekiq.logger.info "Enabling systemd notification integration"
13
+ config.logger.info "Enabling systemd notification integration"
14
14
  require "sidekiq/sd_notify"
15
15
  config.on(:startup) do
16
16
  Sidekiq::SdNotify.ready
@@ -31,12 +31,7 @@ begin
31
31
  cli.run
32
32
  rescue => e
33
33
  raise e if $DEBUG
34
- if Sidekiq.error_handlers.length == 0
35
- STDERR.puts e.message
36
- STDERR.puts e.backtrace.join("\n")
37
- else
38
- cli.handle_exception e
39
- end
40
-
34
+ warn e.message
35
+ warn e.backtrace.join("\n")
41
36
  exit 1
42
37
  end