sidekiq 5.2.7 → 7.0.2

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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +465 -5
  3. data/LICENSE.txt +9 -0
  4. data/README.md +32 -42
  5. data/bin/sidekiq +22 -3
  6. data/bin/sidekiqload +80 -77
  7. data/bin/sidekiqmon +8 -0
  8. data/lib/generators/sidekiq/job_generator.rb +57 -0
  9. data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
  10. data/lib/generators/sidekiq/templates/{worker_spec.rb.erb → job_spec.rb.erb} +1 -1
  11. data/lib/generators/sidekiq/templates/{worker_test.rb.erb → job_test.rb.erb} +1 -1
  12. data/lib/sidekiq/api.rb +506 -351
  13. data/lib/sidekiq/capsule.rb +110 -0
  14. data/lib/sidekiq/cli.rb +202 -226
  15. data/lib/sidekiq/client.rb +104 -95
  16. data/lib/sidekiq/component.rb +66 -0
  17. data/lib/sidekiq/config.rb +270 -0
  18. data/lib/sidekiq/deploy.rb +62 -0
  19. data/lib/sidekiq/embedded.rb +61 -0
  20. data/lib/sidekiq/fetch.rb +49 -40
  21. data/lib/sidekiq/job.rb +378 -0
  22. data/lib/sidekiq/job_logger.rb +33 -7
  23. data/lib/sidekiq/job_retry.rb +127 -107
  24. data/lib/sidekiq/job_util.rb +71 -0
  25. data/lib/sidekiq/launcher.rb +197 -103
  26. data/lib/sidekiq/logger.rb +131 -0
  27. data/lib/sidekiq/manager.rb +43 -46
  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 +134 -0
  31. data/lib/sidekiq/middleware/chain.rb +104 -50
  32. data/lib/sidekiq/middleware/current_attributes.rb +58 -0
  33. data/lib/sidekiq/middleware/i18n.rb +7 -7
  34. data/lib/sidekiq/middleware/modules.rb +21 -0
  35. data/lib/sidekiq/monitor.rb +148 -0
  36. data/lib/sidekiq/paginator.rb +28 -16
  37. data/lib/sidekiq/processor.rb +105 -107
  38. data/lib/sidekiq/rails.rb +41 -37
  39. data/lib/sidekiq/redis_client_adapter.rb +115 -0
  40. data/lib/sidekiq/redis_connection.rb +38 -107
  41. data/lib/sidekiq/ring_buffer.rb +29 -0
  42. data/lib/sidekiq/scheduled.rb +111 -49
  43. data/lib/sidekiq/sd_notify.rb +149 -0
  44. data/lib/sidekiq/systemd.rb +24 -0
  45. data/lib/sidekiq/testing/inline.rb +6 -5
  46. data/lib/sidekiq/testing.rb +66 -84
  47. data/lib/sidekiq/transaction_aware_client.rb +44 -0
  48. data/lib/sidekiq/version.rb +3 -1
  49. data/lib/sidekiq/web/action.rb +15 -11
  50. data/lib/sidekiq/web/application.rb +108 -79
  51. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  52. data/lib/sidekiq/web/helpers.rb +128 -105
  53. data/lib/sidekiq/web/router.rb +23 -19
  54. data/lib/sidekiq/web.rb +56 -107
  55. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  56. data/lib/sidekiq.rb +92 -182
  57. data/sidekiq.gemspec +45 -16
  58. data/web/assets/images/apple-touch-icon.png +0 -0
  59. data/web/assets/javascripts/application.js +130 -61
  60. data/web/assets/javascripts/base-charts.js +106 -0
  61. data/web/assets/javascripts/chart.min.js +13 -0
  62. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  63. data/web/assets/javascripts/dashboard-charts.js +166 -0
  64. data/web/assets/javascripts/dashboard.js +36 -292
  65. data/web/assets/javascripts/metrics.js +236 -0
  66. data/web/assets/stylesheets/application-dark.css +147 -0
  67. data/web/assets/stylesheets/application-rtl.css +2 -95
  68. data/web/assets/stylesheets/application.css +102 -522
  69. data/web/locales/ar.yml +71 -65
  70. data/web/locales/cs.yml +62 -62
  71. data/web/locales/da.yml +52 -52
  72. data/web/locales/de.yml +65 -53
  73. data/web/locales/el.yml +43 -24
  74. data/web/locales/en.yml +84 -66
  75. data/web/locales/es.yml +70 -54
  76. data/web/locales/fa.yml +65 -65
  77. data/web/locales/fr.yml +69 -62
  78. data/web/locales/he.yml +65 -64
  79. data/web/locales/hi.yml +59 -59
  80. data/web/locales/it.yml +53 -53
  81. data/web/locales/ja.yml +73 -64
  82. data/web/locales/ko.yml +52 -52
  83. data/web/locales/lt.yml +83 -0
  84. data/web/locales/nb.yml +61 -61
  85. data/web/locales/nl.yml +52 -52
  86. data/web/locales/pl.yml +45 -45
  87. data/web/locales/pt-br.yml +63 -55
  88. data/web/locales/pt.yml +51 -51
  89. data/web/locales/ru.yml +68 -63
  90. data/web/locales/sv.yml +53 -53
  91. data/web/locales/ta.yml +60 -60
  92. data/web/locales/uk.yml +62 -61
  93. data/web/locales/ur.yml +64 -64
  94. data/web/locales/vi.yml +83 -0
  95. data/web/locales/zh-cn.yml +43 -16
  96. data/web/locales/zh-tw.yml +42 -8
  97. data/web/views/_footer.erb +6 -3
  98. data/web/views/_job_info.erb +19 -2
  99. data/web/views/_nav.erb +1 -1
  100. data/web/views/_poll_link.erb +3 -6
  101. data/web/views/_summary.erb +7 -7
  102. data/web/views/busy.erb +74 -22
  103. data/web/views/dashboard.erb +58 -18
  104. data/web/views/dead.erb +3 -3
  105. data/web/views/layout.erb +3 -1
  106. data/web/views/metrics.erb +80 -0
  107. data/web/views/metrics_for_job.erb +69 -0
  108. data/web/views/morgue.erb +10 -7
  109. data/web/views/queue.erb +23 -10
  110. data/web/views/queues.erb +10 -2
  111. data/web/views/retries.erb +12 -9
  112. data/web/views/retry.erb +3 -3
  113. data/web/views/scheduled.erb +6 -3
  114. metadata +84 -69
  115. data/.circleci/config.yml +0 -61
  116. data/.github/contributing.md +0 -32
  117. data/.github/issue_template.md +0 -11
  118. data/.gitignore +0 -15
  119. data/.travis.yml +0 -11
  120. data/3.0-Upgrade.md +0 -70
  121. data/4.0-Upgrade.md +0 -53
  122. data/5.0-Upgrade.md +0 -56
  123. data/COMM-LICENSE +0 -97
  124. data/Ent-Changes.md +0 -238
  125. data/Gemfile +0 -23
  126. data/LICENSE +0 -9
  127. data/Pro-2.0-Upgrade.md +0 -138
  128. data/Pro-3.0-Upgrade.md +0 -44
  129. data/Pro-4.0-Upgrade.md +0 -35
  130. data/Pro-Changes.md +0 -759
  131. data/Rakefile +0 -9
  132. data/bin/sidekiqctl +0 -20
  133. data/code_of_conduct.md +0 -50
  134. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  135. data/lib/sidekiq/core_ext.rb +0 -1
  136. data/lib/sidekiq/ctl.rb +0 -221
  137. data/lib/sidekiq/delay.rb +0 -42
  138. data/lib/sidekiq/exception_handler.rb +0 -29
  139. data/lib/sidekiq/extensions/action_mailer.rb +0 -57
  140. data/lib/sidekiq/extensions/active_record.rb +0 -40
  141. data/lib/sidekiq/extensions/class_methods.rb +0 -40
  142. data/lib/sidekiq/extensions/generic_proxy.rb +0 -31
  143. data/lib/sidekiq/logging.rb +0 -122
  144. data/lib/sidekiq/middleware/server/active_record.rb +0 -23
  145. data/lib/sidekiq/util.rb +0 -66
  146. data/lib/sidekiq/worker.rb +0 -220
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 408fa69245bc5dbd48894529237ed6bd94fb62f084e12c3cf21c5c2b44466555
4
- data.tar.gz: 7052699621d277bf59aaee779f93c0f98089a2d0bbc5d40f4d991faa52ef7b90
3
+ metadata.gz: 9456d6050f916f7777b11ff32528c3c872fefa5a4e7afa32773e030ca9b6df7e
4
+ data.tar.gz: 501ca5569b669bb5c5eaf80d4ae3c1c8cc20e7c51235cfc72abcb2d3b25bc6ea
5
5
  SHA512:
6
- metadata.gz: e128875c94c37f82fec77c4071e6abafd5326a1a949bff0ff90377d6a54c18b117a7753c439e7d9611e87dfc57c752251f6b2bf3cfb1c799d95016d2a112a211
7
- data.tar.gz: 5aabe50f97494052e73190fb8aa96f57b253e5855416938ef0644013012678640d620c8e05484c4d945ea558d55413c7c1625967ab40f402680b7ded27133321
6
+ metadata.gz: 0267fbbfbf028e4f9c091e28c31b4b18de6c795e32359c38cf2f09da7c2bc43654c1b3482443befbaada0715fdb591ae74037bed99069bd26db5fca961befec1
7
+ data.tar.gz: f2a5275b2fa2a47e1aa0b6d5a5009cc373dddd64f0226d481f575079fee6a91ebc8ddacfc96536085df9bae685bf45fd42660eecf656d07521033b921f8125ed
data/Changes.md CHANGED
@@ -1,6 +1,466 @@
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
+ 7.0.2
6
+ ----------
7
+
8
+ - Improve compatibility with custom loggers [#5673]
9
+ - Add queue weights on Busy page [#5640]
10
+ - Add BID link on job_info page if job is part of a Batch [#5623]
11
+ - Allow custom extensions to add rows/links within Job detail pages [#5624]
12
+ ```ruby
13
+ Sidekiq::Web.custom_job_info_rows << AddAccountLink.new
14
+
15
+ class AddAccountLink
16
+ include CGI::Util
17
+ def add_pair(job)
18
+ # yield a (name, value) pair
19
+ # You can include HTML tags and CSS, Sidekiq does not do any
20
+ # escaping so beware user data injection! Note how we use CGI's
21
+ # `h` escape helper.
22
+ aid = job["account_id"]
23
+ yield "Account", "<a href='/accounts/#{h aid}'>#{h aid}</a>" if aid
24
+ end
25
+ end
26
+ ```
27
+
28
+ 7.0.1
29
+ ----------
30
+
31
+ - Allow an embedding process to reuse its own heartbeat thread
32
+ - Update zh-cn localization
33
+
34
+ 7.0.0
35
+ ----------
36
+
37
+ - Embedded mode!
38
+ - Capsules!!
39
+ - Job Execution metrics!!!
40
+ - See `docs/7.0-Upgrade.md` for release notes
41
+
42
+ 6.5.8
43
+ ----------
44
+
45
+ - Fail if using a bad version of scout_apm [#5616]
46
+ - Add pagination to Busy page [#5556]
47
+ - Speed up WorkSet#each [#5559]
48
+ - Adjust CurrentAttributes to work with the String class name so we aren't referencing the Class within a Rails initializer [#5536]
49
+
50
+ 6.5.7
51
+ ----------
52
+
53
+ - Updates for JA and ZH locales
54
+ - Further optimizations for scheduled polling [#5513]
55
+
56
+ 6.5.6
57
+ ----------
58
+
59
+ - Fix deprecation warnings with redis-rb 4.8.0 [#5484]
60
+ - Lock redis-rb to < 5.0 as we are moving to redis-client in Sidekiq 7.0
61
+
62
+ 6.5.5
63
+ ----------
64
+
65
+ - Fix require issue with job_retry.rb [#5462]
66
+ - Improve Sidekiq::Web compatibility with Rack 3.x
67
+
68
+ 6.5.4
69
+ ----------
70
+
71
+ - Fix invalid code on Ruby 2.5 [#5460]
72
+ - Fix further metrics dependency issues [#5457]
73
+
74
+ 6.5.3
75
+ ----------
76
+
77
+ - Don't require metrics code without explicit opt-in [#5456]
78
+
79
+ 6.5.2
80
+ ----------
81
+
82
+ - [Job Metrics are under active development, help wanted!](https://github.com/mperham/sidekiq/wiki/Metrics#contributing) **BETA**
83
+ - Add `Context` column on queue page which shows any CurrentAttributes [#5450]
84
+ - `sidekiq_retry_in` may now return `:discard` or `:kill` to dynamically stop job retries [#5406]
85
+ - Smarter sorting of processes in /busy Web UI [#5398]
86
+ - Fix broken hamburger menu in mobile UI [#5428]
87
+ - Require redis-rb 4.5.0. Note that Sidekiq will break if you use the
88
+ [`Redis.exists_returns_integer = false`](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#450) flag. [#5394]
89
+
90
+ 6.5.1
91
+ ----------
92
+
93
+ - Fix `push_bulk` breakage [#5387]
94
+
95
+ 6.5.0
96
+ ---------
97
+
98
+ - Substantial refactoring of Sidekiq server internals, part of a larger effort
99
+ 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).
100
+ - **Add beta support for the `redis-client` gem**. This will become the default Redis driver in Sidekiq 7.0. [#5298]
101
+ Read more: https://github.com/mperham/sidekiq/wiki/Using-redis-client
102
+ - **Add beta support for DB transaction-aware client** [#5291]
103
+ Add this line to your initializer and any jobs created during a transaction
104
+ will only be pushed to Redis **after the transaction commits**. You will need to add the
105
+ `after_commit_everywhere` gem to your Gemfile.
106
+ ```ruby
107
+ Sidekiq.transactional_push!
108
+ ```
109
+ This feature does not have a lot of production usage yet; please try it out and let us
110
+ know if you have any issues. It will be fully supported in Sidekiq 7.0 or removed if it
111
+ proves problematic.
112
+ - Fix regression with middleware arguments [#5312]
113
+
114
+ 6.4.2
115
+ ---------
116
+
117
+ - Strict argument checking now runs after client-side middleware [#5246]
118
+ - Fix page events with live polling [#5184]
119
+ - Many under-the-hood changes to remove all usage of the term "worker"
120
+ from the Sidekiq codebase and APIs. This mostly involved RDoc and local
121
+ variable names but a few constants and public APIs were changed. The old
122
+ APIs will be removed in Sidekiq 7.0.
123
+ ```
124
+ Sidekiq::DEFAULT_WORKER_OPTIONS -> Sidekiq.default_job_options
125
+ Sidekiq.default_worker_options -> Sidekiq.default_job_options
126
+ Sidekiq::Queues["default"].jobs_by_worker(HardJob) -> Sidekiq::Queues["default"].jobs_by_class(HardJob)
127
+ ```
128
+
129
+ 6.4.1
130
+ ---------
131
+
132
+ - Fix pipeline/multi deprecations in redis-rb 4.6
133
+ - Fix sidekiq.yml YAML load errors on Ruby 3.1 [#5141]
134
+ - Sharding support for `perform_bulk` [#5129]
135
+ - Refactor job logger for SPEEEEEEED
136
+
137
+ 6.4.0
138
+ ---------
139
+
140
+ - **SECURITY**: Validate input to avoid possible DoS in Web UI.
141
+ - Add **strict argument checking** [#5071]
142
+ Sidekiq will now log a warning if JSON-unsafe arguments are passed to `perform_async`.
143
+ Add `Sidekiq.strict_args!(false)` to your initializer to disable this warning.
144
+ This warning will switch to an exception in Sidekiq 7.0.
145
+ - Note that Delayed Extensions will be removed in Sidekiq 7.0 [#5076]
146
+ - Add `perform_{inline,sync}` in Sidekiq::Job to run a job synchronously [#5061, hasan-ally]
147
+ ```ruby
148
+ SomeJob.perform_async(args...)
149
+ SomeJob.perform_sync(args...)
150
+ SomeJob.perform_inline(args...)
151
+ ```
152
+ You can also dynamically redirect a job to run synchronously:
153
+ ```ruby
154
+ SomeJob.set("sync": true).perform_async(args...) # will run via perform_inline
155
+ ```
156
+ - Replace Sidekiq::Worker `app/workers` generator with Sidekiq::Job `app/sidekiq` generator [#5055]
157
+ ```
158
+ bin/rails generate sidekiq:job ProcessOrderJob
159
+ ```
160
+ - Fix job retries losing CurrentAttributes [#5090]
161
+ - Tweak shutdown to give long-running threads time to cleanup [#5095]
162
+
163
+ 6.3.1
164
+ ---------
165
+
166
+ - Fix keyword arguments error with CurrentAttributes on Ruby 3.0 [#5048]
167
+
168
+ 6.3.0
169
+ ---------
170
+
171
+ - **BREAK**: The Web UI has been refactored to remove jQuery. Any UI extensions
172
+ which use jQuery will break.
173
+ - **FEATURE**: Sidekiq.logger has been enhanced so any `Rails.logger`
174
+ output in jobs now shows up in the Sidekiq console. Remove any logger
175
+ hacks in your initializer and see if it Just Works™ now. [#5021]
176
+ - **FEATURE**: Add `Sidekiq::Job` alias for `Sidekiq::Worker`, to better
177
+ reflect industry standard terminology. You can now do this:
178
+ ```ruby
179
+ class MyJob
180
+ include Sidekiq::Job
181
+ sidekiq_options ...
182
+ def perform(args)
183
+ end
184
+ end
185
+ ```
186
+ - **FEATURE**: Support for serializing ActiveSupport::CurrentAttributes into each job. [#4982]
187
+ ```ruby
188
+ # config/initializers/sidekiq.rb
189
+ require "sidekiq/middleware/current_attributes"
190
+ Sidekiq::CurrentAttributes.persist(Myapp::Current) # Your AS::CurrentAttributes singleton
191
+ ```
192
+ - **FEATURE**: Add `Sidekiq::Worker.perform_bulk` for enqueuing jobs in bulk,
193
+ similar to `Sidekiq::Client.push_bulk` [#5042]
194
+ ```ruby
195
+ MyJob.perform_bulk([[1], [2], [3]])
196
+ ```
197
+ - Implement `queue_as`, `wait` and `wait_until` for ActiveJob compatibility [#5003]
198
+ - Scheduler now uses Lua to reduce Redis load and network roundtrips [#5044]
199
+ - Retry Redis operation if we get an `UNBLOCKED` Redis error [#4985]
200
+ - Run existing signal traps, if any, before running Sidekiq's trap [#4991]
201
+ - Fix fetch bug when using weighted queues which caused Sidekiq to stop
202
+ processing queues randomly [#5031]
203
+
204
+ 6.2.2
205
+ ---------
206
+
207
+ - Reduce retry jitter, add jitter to `sidekiq_retry_in` values [#4957]
208
+ - Minimize scheduler load on Redis at scale [#4882]
209
+ - Improve logging of delay jobs [#4904, BuonOno]
210
+ - Minor CSS improvements for buttons and tables, design PRs always welcome!
211
+ - Tweak Web UI `Cache-Control` header [#4966]
212
+ - Rename internal API class `Sidekiq::Job` to `Sidekiq::JobRecord` [#4955]
213
+
214
+ 6.2.1
215
+ ---------
216
+
217
+ - Update RTT warning logic to handle transient RTT spikes [#4851]
218
+ - Fix very low priority CVE on unescaped queue name [#4852]
219
+ - Add note about sessions and Rails apps in API mode
220
+
221
+ 6.2.0
222
+ ---------
223
+
224
+ - Store Redis RTT and log if poor [#4824]
225
+ - Add process/thread stats to Busy page [#4806]
226
+ - Improve Web UI on mobile devices [#4840]
227
+ - **Refactor Web UI session usage** [#4804]
228
+ Numerous people have hit "Forbidden" errors and struggled with Sidekiq's
229
+ Web UI session requirement. If you have code in your initializer for
230
+ Web sessions, it's quite possible it will need to be removed. Here's
231
+ an overview:
232
+ ```
233
+ Sidekiq::Web needs a valid Rack session for CSRF protection. If this is a Rails app,
234
+ make sure you mount Sidekiq::Web *inside* your routes in `config/routes.rb` so
235
+ Sidekiq can reuse the Rails session:
236
+
237
+ Rails.application.routes.draw do
238
+ mount Sidekiq::Web => "/sidekiq"
239
+ ....
240
+ end
241
+
242
+ If this is a bare Rack app, use a session middleware before Sidekiq::Web:
243
+
244
+ # first, use IRB to create a shared secret key for sessions and commit it
245
+ require 'securerandom'; File.open(".session.key", "w") {|f| f.write(SecureRandom.hex(32)) }
246
+
247
+ # now, update your Rack app to include the secret with a session cookie middleware
248
+ use Rack::Session::Cookie, secret: File.read(".session.key"), same_site: true, max_age: 86400
249
+ run Sidekiq::Web
250
+
251
+ If this is a Rails app in API mode, you need to enable sessions.
252
+
253
+ https://guides.rubyonrails.org/api_app.html#using-session-middlewares
254
+ ```
255
+
256
+ 6.1.3
257
+ ---------
258
+
259
+ - Warn if Redis is configured to evict data under memory pressure [#4752]
260
+ - Add process RSS on the Busy page [#4717]
261
+
262
+ 6.1.2
263
+ ---------
264
+
265
+ - Improve readability in dark mode Web UI [#4674]
266
+ - Fix Web UI crash with corrupt session [#4672]
267
+ - Allow middleware to yield arguments [#4673, @eugeneius]
268
+ - Migrate CI from CircleCI to GitHub Actions [#4677]
269
+
270
+ 6.1.1
271
+ ---------
272
+
273
+ - Jobs are now sorted by age in the Busy Workers table. [#4641]
274
+ - Fix "check all" JS logic in Web UI [#4619]
275
+
276
+ 6.1.0
277
+ ---------
278
+
279
+ - Web UI - Dark Mode fixes [#4543, natematykiewicz]
280
+ - Ensure `Rack::ContentLength` is loaded as middleware for correct Web UI responses [#4541]
281
+ - Avoid exception dumping SSL store in Redis connection logging [#4532]
282
+ - Better error messages in Sidekiq::Client [#4549]
283
+ - Remove rack-protection, reimplement CSRF protection [#4588]
284
+ - Require redis-rb 4.2 [#4591]
285
+ - Update to jquery 1.12.4 [#4593]
286
+ - Refactor internal fetch logic and API [#4602]
287
+
288
+ 6.0.7
289
+ ---------
290
+
291
+ - Refactor systemd integration to work better with custom binaries [#4511]
292
+ - Don't connect to Redis at process exit if not needed [#4502]
293
+ - Remove Redis connection naming [#4479]
294
+ - Fix Redis Sentinel password redaction [#4499]
295
+ - Add Vietnamese locale (vi) [#4528]
296
+
297
+ 6.0.6
298
+ ---------
299
+
300
+ - **Integrate with systemd's watchdog and notification features** [#4488]
301
+ Set `Type=notify` in [sidekiq.service](https://github.com/mperham/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
302
+ - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
303
+ - Fix edge case where a job can be pushed without a queue.
304
+ - Flush job stats at exit [#4498]
305
+ - Check RAILS_ENV before RACK_ENV [#4493]
306
+ - Add Lithuanian locale [#4476]
307
+
308
+ 6.0.5
309
+ ---------
310
+
311
+ - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
312
+ - Update APIs to use `UNLINK`, not `DEL`. [#4449]
313
+ - Fix Ruby 2.7 warnings [#4412]
314
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/mperham/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
315
+
316
+ 6.0.4
317
+ ---------
318
+
319
+ - Fix ActiveJob's `sidekiq_options` integration [#4404]
320
+ - Sidekiq Pro users will now see a Pause button next to each queue in
321
+ the Web UI, allowing them to pause queues manually [#4374, shayonj]
322
+ - Fix Sidekiq::Workers API unintentional change in 6.0.2 [#4387]
323
+
324
+
325
+ 6.0.3
326
+ ---------
327
+
328
+ - Fix `Sidekiq::Client.push_bulk` API which was erroneously putting
329
+ invalid `at` values in the job payloads [#4321]
330
+
331
+ 6.0.2
332
+ ---------
333
+
334
+ - Fix Sidekiq Enterprise's rolling restart functionality, broken by refactoring in 6.0.0. [#4334]
335
+ - More internal refactoring and performance tuning [fatkodima]
336
+
337
+ 6.0.1
338
+ ---------
339
+
340
+ - **Performance tuning**, Sidekiq should be 10-15% faster now [#4303, 4299,
341
+ 4269, fatkodima]
342
+ - **Dark Mode support in Web UI** (further design polish welcome!) [#4227, mperham,
343
+ fatkodima, silent-e]
344
+ - **Job-specific log levels**, allowing you to turn on debugging for
345
+ problematic workers. [fatkodima, #4287]
346
+ ```ruby
347
+ MyWorker.set(log_level: :debug).perform_async(...)
348
+ ```
349
+ - **Ad-hoc job tags**. You can tag your jobs with, e.g, subdomain, tenant, country,
350
+ locale, application, version, user/client, "alpha/beta/pro/ent", types of jobs,
351
+ teams/people responsible for jobs, additional metadata, etc.
352
+ Tags are shown on different pages with job listings. Sidekiq Pro users
353
+ can filter based on them [fatkodima, #4280]
354
+ ```ruby
355
+ class MyWorker
356
+ include Sidekiq::Worker
357
+ sidekiq_options tags: ['bank-ops', 'alpha']
358
+ ...
359
+ end
360
+ ```
361
+ - Fetch scheduled jobs in batches before pushing into specific queues.
362
+ This will decrease enqueueing time of scheduled jobs by a third. [fatkodima, #4273]
363
+ ```
364
+ ScheduledSet with 10,000 jobs
365
+ Before: 56.6 seconds
366
+ After: 39.2 seconds
367
+ ```
368
+ - Compress error backtraces before pushing into Redis, if you are
369
+ storing error backtraces, this will halve the size of your RetrySet
370
+ in Redis [fatkodima, #4272]
371
+ ```
372
+ RetrySet with 100,000 jobs
373
+ Before: 261 MB
374
+ After: 129 MB
375
+ ```
376
+ - Support display of ActiveJob 6.0 payloads in the Web UI [#4263]
377
+ - Add `SortedSet#scan` for pattern based scanning. For large sets this API will be **MUCH** faster
378
+ than standard iteration using each. [fatkodima, #4262]
379
+ ```ruby
380
+ Sidekiq::DeadSet.new.scan("UnreliableApi") do |job|
381
+ job.retry
382
+ end
383
+ ```
384
+ - Dramatically speed up SortedSet#find\_job(jid) by using Redis's ZSCAN
385
+ support, approx 10x faster. [fatkodima, #4259]
386
+ ```
387
+ zscan 0.179366 0.047727 0.227093 ( 1.161376)
388
+ enum 8.522311 0.419826 8.942137 ( 9.785079)
389
+ ```
390
+ - Respect rails' generators `test_framework` option and gracefully handle extra `worker` suffix on generator [fatkodima, #4256]
391
+ - Add ability to sort 'Enqueued' page on Web UI by position in the queue [fatkodima, #4248]
392
+ - Support `Client.push_bulk` with different delays [fatkodima, #4243]
393
+ ```ruby
394
+ Sidekiq::Client.push_bulk("class" => FooJob, "args" => [[1], [2]], "at" => [1.minute.from_now.to_f, 5.minutes.from_now.to_f])
395
+ ```
396
+ - Easier way to test enqueuing specific ActionMailer and ActiveRecord delayed jobs. Instead of manually
397
+ parsing embedded class, you can now test by fetching jobs for specific classes. [fatkodima, #4292]
398
+ ```ruby
399
+ assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs_for(FooMailer).size
400
+ ```
401
+ - Add `sidekiqmon` to gemspec executables [#4242]
402
+ - Gracefully handle `Sidekiq.logger = nil` [#4240]
403
+ - Inject Sidekiq::LogContext module if user-supplied logger does not include it [#4239]
404
+
405
+ 6.0
406
+ ---------
407
+
408
+ This release has major breaking changes. Read and test carefully in production.
409
+
410
+ - With Rails 6.0.2+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
411
+ features/internals like the retry subsystem. [#4213, pirj]
412
+ ```ruby
413
+ class MyJob < ActiveJob::Base
414
+ queue_as :myqueue
415
+ sidekiq_options retry: 10, backtrace: 20
416
+ def perform(...)
417
+ end
418
+ end
419
+ ```
420
+ - Logging has been redesigned to allow for pluggable log formatters:
421
+ ```ruby
422
+ Sidekiq.configure_server do |config|
423
+ config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
424
+ end
425
+ ```
426
+ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for more details.
427
+ - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
428
+ variable. This variable is meant to hold the name of the environment
429
+ variable which contains your Redis URL, so that you can switch Redis
430
+ providers quickly and easily with a single variable change. It is not
431
+ meant to hold the actual Redis URL itself. If you want to manually set
432
+ the Redis URL (not recommended as it implies you have no failover),
433
+ then you may set `REDIS_URL` directly. [#3969]
434
+ - **BREAKING CHANGE** Increase default shutdown timeout from 8 seconds
435
+ to 25 seconds. Both Heroku and ECS now use 30 second shutdown timeout
436
+ by default and we want Sidekiq to take advantage of this time. If you
437
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
438
+ get the old behavior. [#3968]
439
+ - **BREAKING CHANGE** Remove the daemonization, logfile and pidfile
440
+ arguments to Sidekiq. Use a proper process supervisor (e.g. systemd or
441
+ foreman) to manage Sidekiq. See the Deployment wiki page for links to
442
+ more resources.
443
+ - Integrate the StandardRB code formatter to ensure consistent code
444
+ styling. [#4114, gearnode]
445
+
446
+ 5.2.10
447
+ ---------
448
+
449
+ - Backport fix for CVE-2022-23837.
450
+ - Migrate to `exists?` for redis-rb.
451
+ - Lock redis-rb to <4.6 to avoid deprecations.
452
+
453
+ 5.2.9
454
+ ---------
455
+
456
+ - Release Rack lock due to a cascade of CVEs. [#4566]
457
+ Pro-tip: don't lock Rack.
458
+
459
+ 5.2.8
460
+ ---------
461
+
462
+ - Lock to Rack 2.0.x to prevent future incompatibilities
463
+ - Fix invalid reference in `sidekiqctl`
4
464
 
5
465
  5.2.7
6
466
  ---------
@@ -155,7 +615,7 @@ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
155
615
  - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
156
616
  - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
157
617
  of random hex bytes.
158
- - Please see the [5.0 Upgrade notes](5.0-Upgrade.md) for more detail.
618
+ - Please see the [5.0 Upgrade notes](docs/5.0-Upgrade.md) for more detail.
159
619
 
160
620
  4.2.10
161
621
  -----------
@@ -373,7 +833,7 @@ Sidekiq::Queues.clear_all
373
833
  - Sidekiq's internals have been completely overhauled for performance
374
834
  and to remove dependencies. This has resulted in major speedups, as
375
835
  [detailed on my blog](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
376
- - See the [4.0 upgrade notes](4.0-Upgrade.md) for more detail.
836
+ - See the [4.0 upgrade notes](docs/4.0-Upgrade.md) for more detail.
377
837
 
378
838
  3.5.4
379
839
  -----------
@@ -640,7 +1100,7 @@ sidekiq_options :dead => false, :retry => 5
640
1100
  3.0.0
641
1101
  -----------
642
1102
 
643
- Please see [3.0-Upgrade.md](3.0-Upgrade.md) for more comprehensive upgrade notes.
1103
+ Please see [3.0-Upgrade.md](docs/3.0-Upgrade.md) for more comprehensive upgrade notes.
644
1104
 
645
1105
  - **Dead Job Queue** - jobs which run out of retries are now moved to a dead
646
1106
  job queue. These jobs must be retried manually or they will expire
@@ -684,7 +1144,7 @@ Sidekiq::Client.via(ConnectionPool.new { Redis.new }) do
684
1144
  end
685
1145
  ```
686
1146
  **Sharding support does require a breaking change to client-side
687
- middleware, see 3.0-Upgrade.md.**
1147
+ middleware, see docs/3.0-Upgrade.md.**
688
1148
  - New Chinese, Greek, Swedish and Czech translations for the Web UI.
689
1149
  - Updated most languages translations for the new UI features.
690
1150
  - **Remove official Capistrano integration** - this integration has been
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,10 +2,7 @@ Sidekiq
2
2
  ==============
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
5
- [![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq)
6
- [![Build Status](https://circleci.com/gh/mperham/sidekiq/tree/master.svg?style=svg)](https://circleci.com/gh/mperham/sidekiq/tree/master)
7
- [![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)
8
-
5
+ ![Build](https://github.com/mperham/sidekiq/workflows/CI/badge.svg)
9
6
 
10
7
  Simple, efficient background processing for Ruby.
11
8
 
@@ -13,97 +10,90 @@ Sidekiq uses threads to handle many jobs at the same time in the
13
10
  same process. It does not require Rails but will integrate tightly with
14
11
  Rails to make background processing dead simple.
15
12
 
16
- Sidekiq is compatible with Resque. It uses the exact same
17
- message format as Resque so it can integrate into an existing Resque processing farm.
18
- You can have Sidekiq and Resque run side-by-side at the same time and
19
- use the Resque client to enqueue jobs in Redis to be processed by Sidekiq.
20
-
21
13
  Performance
22
14
  ---------------
23
15
 
24
- Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput
25
- -----------------|------|---------|---------|------------------------
26
- Sidekiq 4.0.0 | 10ms | 151 MB | 22 sec | **4500 jobs/sec**
27
- Sidekiq 3.5.1 | 22ms | 1257 MB | 125 sec | 800 jobs/sec
28
- Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec
29
- DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec
16
+ Version | Latency | Garbage created for 10k jobs | Time to process 100k jobs | Throughput | Ruby
17
+ -----------------|------|---------|---------|------------------------|-----
18
+ Sidekiq 6.0.2 | 3 ms | 156 MB | 14.0 sec| **7100 jobs/sec** | MRI 2.6.3
19
+ Sidekiq 6.0.0 | 3 ms | 156 MB | 19 sec | 5200 jobs/sec | MRI 2.6.3
20
+ Sidekiq 4.0.0 | 10 ms | 151 MB | 22 sec | 4500 jobs/sec |
21
+ Sidekiq 3.5.1 | 22 ms | 1257 MB | 125 sec | 800 jobs/sec |
22
+ Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec |
23
+ DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec |
30
24
 
31
- <small>This benchmark can be found in `bin/sidekiqload`.</small>
25
+ This benchmark can be found in `bin/sidekiqload` and assumes a Redis network latency of 1ms.
32
26
 
33
27
  Requirements
34
28
  -----------------
35
29
 
36
- Sidekiq supports CRuby 2.2.2+ and JRuby 9k.
30
+ - Redis: 6.2+
31
+ - Ruby: MRI 2.7+ or JRuby 9.3+.
37
32
 
38
- All Rails releases >= 4.0 are officially supported.
39
-
40
- Redis 2.8 or greater is required. 3.0.3+ is recommended for large
41
- installations with thousands of worker threads.
33
+ Sidekiq 7.0 supports Rails 6.0+ but does not require it.
42
34
 
43
35
 
44
36
  Installation
45
37
  -----------------
46
38
 
47
- gem install sidekiq
39
+ bundle add sidekiq
48
40
 
49
41
 
50
42
  Getting Started
51
43
  -----------------
52
44
 
53
45
  See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
54
- You can watch [this Youtube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
46
+ You can watch [this YouTube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
55
47
  Sidekiq and see its features in action. Here's the Web UI:
56
48
 
57
- ![Web UI](https://github.com/mperham/sidekiq/raw/master/examples/web-ui.png)
49
+ ![Web UI](https://github.com/mperham/sidekiq/raw/main/examples/web-ui.png)
58
50
 
59
51
 
60
52
  Want to Upgrade?
61
53
  -------------------
62
54
 
55
+ Use `bundle up sidekiq` to upgrade Sidekiq and all its dependencies.
56
+ Upgrade notes between each major version can be found in the `docs/` directory.
57
+
63
58
  I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
64
59
  features, a commercial-friendly license and allow you to support high
65
60
  quality open source development all at the same time. Please see the
66
- [Sidekiq](http://sidekiq.org/) homepage for more detail.
67
-
68
- Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
69
- features and changes to Sidekiq and its bigger siblings.
61
+ [Sidekiq](https://sidekiq.org/) homepage for more detail.
70
62
 
71
63
 
72
64
  Problems?
73
65
  -----------------
74
66
 
75
- **Please do not directly email any Sidekiq committers with questions or problems.** A community is best served when discussions are held in public.
67
+ **Please do not directly email any Sidekiq committers with questions or problems.**
68
+ A community is best served when discussions are held in public.
76
69
 
77
70
  If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
78
71
  Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
79
72
 
80
- Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at http://sidekiq.org; email support@contribsys.com for help.
73
+ Sidekiq Pro and Sidekiq Enterprise customers get private email support.
74
+ You can purchase at https://sidekiq.org; email support@contribsys.com for help.
81
75
 
82
76
  Useful resources:
83
77
 
84
78
  * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
85
- * Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
79
+ * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
86
80
  * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q &amp; A.
87
81
 
88
- **No support via Twitter**
89
-
90
- Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
91
- See the [Sidekiq support page](http://sidekiq.org/support.html) for details.
82
+ Every Friday morning is Sidekiq office hour: I video chat and answer questions.
83
+ See the [Sidekiq support page](https://sidekiq.org/support.html) for details.
92
84
 
93
- Thanks
85
+ Contributing
94
86
  -----------------
95
87
 
96
- Sidekiq stays fast by using the [JProfiler java profiler](http://www.ej-technologies.com/products/jprofiler/overview.html) to find and fix
97
- performance problems on JRuby. Unfortunately MRI does not have good multithreaded profiling tools.
98
-
88
+ Please see [the contributing guidelines](https://github.com/mperham/sidekiq/blob/main/.github/contributing.md).
99
89
 
100
90
  License
101
91
  -----------------
102
92
 
103
- Please see [LICENSE](https://github.com/mperham/sidekiq/blob/master/LICENSE) for licensing details.
104
-
93
+ Please see [LICENSE.txt](https://github.com/mperham/sidekiq/blob/main/LICENSE.txt) for licensing details.
94
+ The license for Sidekiq Pro and Sidekiq Enterprise can be found in [COMM-LICENSE.txt](https://github.com/mperham/sidekiq/blob/main/COMM-LICENSE.txt).
105
95
 
106
96
  Author
107
97
  -----------------
108
98
 
109
- Mike Perham, [@mperham](https://twitter.com/mperham) / [@sidekiq](https://twitter.com/sidekiq), [http://www.mikeperham.com](http://www.mikeperham.com) / [http://www.contribsys.com](http://www.contribsys.com)
99
+ 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)