sidekiq 6.0.4 → 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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +336 -6
  3. data/LICENSE.txt +9 -0
  4. data/README.md +22 -20
  5. data/bin/sidekiq +22 -3
  6. data/bin/sidekiqload +71 -76
  7. data/bin/sidekiqmon +1 -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 +365 -230
  13. data/lib/sidekiq/capsule.rb +110 -0
  14. data/lib/sidekiq/cli.rb +120 -86
  15. data/lib/sidekiq/client.rb +81 -85
  16. data/lib/sidekiq/{util.rb → component.rb} +13 -14
  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 +42 -32
  21. data/lib/sidekiq/{worker.rb → job.rb} +165 -34
  22. data/lib/sidekiq/job_logger.rb +18 -30
  23. data/lib/sidekiq/job_retry.rb +80 -60
  24. data/lib/sidekiq/job_util.rb +71 -0
  25. data/lib/sidekiq/launcher.rb +173 -85
  26. data/lib/sidekiq/logger.rb +13 -47
  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 +134 -0
  31. data/lib/sidekiq/middleware/chain.rb +90 -46
  32. data/lib/sidekiq/middleware/current_attributes.rb +58 -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 +19 -4
  36. data/lib/sidekiq/paginator.rb +17 -9
  37. data/lib/sidekiq/processor.rb +57 -60
  38. data/lib/sidekiq/rails.rb +33 -23
  39. data/lib/sidekiq/redis_client_adapter.rb +115 -0
  40. data/lib/sidekiq/redis_connection.rb +21 -87
  41. data/lib/sidekiq/ring_buffer.rb +29 -0
  42. data/lib/sidekiq/scheduled.rb +102 -39
  43. data/lib/sidekiq/sd_notify.rb +149 -0
  44. data/lib/sidekiq/systemd.rb +24 -0
  45. data/lib/sidekiq/testing/inline.rb +4 -4
  46. data/lib/sidekiq/testing.rb +43 -72
  47. data/lib/sidekiq/transaction_aware_client.rb +44 -0
  48. data/lib/sidekiq/version.rb +2 -1
  49. data/lib/sidekiq/web/action.rb +3 -3
  50. data/lib/sidekiq/web/application.rb +47 -24
  51. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  52. data/lib/sidekiq/web/helpers.rb +59 -47
  53. data/lib/sidekiq/web/router.rb +6 -5
  54. data/lib/sidekiq/web.rb +31 -74
  55. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  56. data/lib/sidekiq.rb +86 -199
  57. data/sidekiq.gemspec +36 -7
  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 -273
  65. data/web/assets/javascripts/metrics.js +236 -0
  66. data/web/assets/stylesheets/application-dark.css +146 -124
  67. data/web/assets/stylesheets/application-rtl.css +2 -95
  68. data/web/assets/stylesheets/application.css +100 -529
  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 -65
  73. data/web/locales/el.yml +43 -24
  74. data/web/locales/en.yml +83 -67
  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 -65
  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 +17 -1
  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 +70 -21
  103. data/web/views/dashboard.erb +58 -18
  104. data/web/views/dead.erb +1 -1
  105. data/web/views/layout.erb +3 -2
  106. data/web/views/metrics.erb +80 -0
  107. data/web/views/metrics_for_job.erb +69 -0
  108. data/web/views/morgue.erb +7 -7
  109. data/web/views/queue.erb +15 -11
  110. data/web/views/queues.erb +4 -4
  111. data/web/views/retries.erb +8 -8
  112. data/web/views/retry.erb +1 -1
  113. data/web/views/scheduled.erb +2 -2
  114. metadata +79 -55
  115. data/.circleci/config.yml +0 -82
  116. data/.github/contributing.md +0 -32
  117. data/.github/issue_template.md +0 -11
  118. data/.gitignore +0 -13
  119. data/.standard.yml +0 -20
  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/6.0-Upgrade.md +0 -72
  124. data/COMM-LICENSE +0 -97
  125. data/Ent-2.0-Upgrade.md +0 -37
  126. data/Ent-Changes.md +0 -256
  127. data/Gemfile +0 -24
  128. data/Gemfile.lock +0 -199
  129. data/LICENSE +0 -9
  130. data/Pro-2.0-Upgrade.md +0 -138
  131. data/Pro-3.0-Upgrade.md +0 -44
  132. data/Pro-4.0-Upgrade.md +0 -35
  133. data/Pro-5.0-Upgrade.md +0 -25
  134. data/Pro-Changes.md +0 -776
  135. data/Rakefile +0 -10
  136. data/code_of_conduct.md +0 -50
  137. data/lib/generators/sidekiq/worker_generator.rb +0 -57
  138. data/lib/sidekiq/delay.rb +0 -41
  139. data/lib/sidekiq/exception_handler.rb +0 -27
  140. data/lib/sidekiq/extensions/action_mailer.rb +0 -47
  141. data/lib/sidekiq/extensions/active_record.rb +0 -42
  142. data/lib/sidekiq/extensions/class_methods.rb +0 -42
  143. data/lib/sidekiq/extensions/generic_proxy.rb +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bfe129c0a4abfedbab370011613f8acefe77791327e85993a4048be63507a6d
4
- data.tar.gz: 2a67cee7d61bf27ef76fb54fe077b981de6c9286c3e46dc7303e47a31087fb54
3
+ metadata.gz: 9456d6050f916f7777b11ff32528c3c872fefa5a4e7afa32773e030ca9b6df7e
4
+ data.tar.gz: 501ca5569b669bb5c5eaf80d4ae3c1c8cc20e7c51235cfc72abcb2d3b25bc6ea
5
5
  SHA512:
6
- metadata.gz: a989ad41c075a9c7accf401d14da3ef28c836668a9e3f49ec09a61f7114b7198c3485ded79c06fa4bb3f3c22271db9a7eaae0f156667d400178d26d6055e7ef0
7
- data.tar.gz: f7200ade5b0f69f2ffbc8c708ed28d0efff3f6b6708ecdbe60ec22903ef2c58a78f362fc8a59540b045d17d91a0e19adbd647dbddd0a166f530087908715337d
6
+ metadata.gz: 0267fbbfbf028e4f9c091e28c31b4b18de6c795e32359c38cf2f09da7c2bc43654c1b3482443befbaada0715fdb591ae74037bed99069bd26db5fca961befec1
7
+ data.tar.gz: f2a5275b2fa2a47e1aa0b6d5a5009cc373dddd64f0226d481f575079fee6a91ebc8ddacfc96536085df9bae685bf45fd42660eecf656d07521033b921f8125ed
data/Changes.md CHANGED
@@ -1,6 +1,317 @@
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)
4
315
 
5
316
  6.0.4
6
317
  ---------
@@ -96,7 +407,7 @@ assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs_for(FooMailer).size
96
407
 
97
408
  This release has major breaking changes. Read and test carefully in production.
98
409
 
99
- - With Rails 6.0.1+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
410
+ - With Rails 6.0.2+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
100
411
  features/internals like the retry subsystem. [#4213, pirj]
101
412
  ```ruby
102
413
  class MyJob < ActiveJob::Base
@@ -132,6 +443,25 @@ See the [Logging wiki page](https://github.com/mperham/sidekiq/wiki/Logging) for
132
443
  - Integrate the StandardRB code formatter to ensure consistent code
133
444
  styling. [#4114, gearnode]
134
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`
464
+
135
465
  5.2.7
136
466
  ---------
137
467
 
@@ -285,7 +615,7 @@ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
285
615
  - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
286
616
  - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
287
617
  of random hex bytes.
288
- - 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.
289
619
 
290
620
  4.2.10
291
621
  -----------
@@ -503,7 +833,7 @@ Sidekiq::Queues.clear_all
503
833
  - Sidekiq's internals have been completely overhauled for performance
504
834
  and to remove dependencies. This has resulted in major speedups, as
505
835
  [detailed on my blog](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
506
- - 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.
507
837
 
508
838
  3.5.4
509
839
  -----------
@@ -770,7 +1100,7 @@ sidekiq_options :dead => false, :retry => 5
770
1100
  3.0.0
771
1101
  -----------
772
1102
 
773
- 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.
774
1104
 
775
1105
  - **Dead Job Queue** - jobs which run out of retries are now moved to a dead
776
1106
  job queue. These jobs must be retried manually or they will expire
@@ -814,7 +1144,7 @@ Sidekiq::Client.via(ConnectionPool.new { Redis.new }) do
814
1144
  end
815
1145
  ```
816
1146
  **Sharding support does require a breaking change to client-side
817
- middleware, see 3.0-Upgrade.md.**
1147
+ middleware, see docs/3.0-Upgrade.md.**
818
1148
  - New Chinese, Greek, Swedish and Czech translations for the Web UI.
819
1149
  - Updated most languages translations for the new UI features.
820
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,11 +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
- [![Test Coverage](https://codeclimate.com/github/mperham/sidekiq/badges/coverage.svg)](https://codeclimate.com/github/mperham/sidekiq/coverage)
7
- [![Build Status](https://circleci.com/gh/mperham/sidekiq/tree/master.svg?style=svg)](https://circleci.com/gh/mperham/sidekiq/tree/master)
8
- [![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)
9
-
5
+ ![Build](https://github.com/mperham/sidekiq/workflows/CI/badge.svg)
10
6
 
11
7
  Simple, efficient background processing for Ruby.
12
8
 
@@ -31,49 +27,51 @@ This benchmark can be found in `bin/sidekiqload` and assumes a Redis network lat
31
27
  Requirements
32
28
  -----------------
33
29
 
34
- - Redis: 4.0+
35
- - Ruby: MRI 2.5+ or JRuby 9.2+.
30
+ - Redis: 6.2+
31
+ - Ruby: MRI 2.7+ or JRuby 9.3+.
36
32
 
37
- Sidekiq 6.0 supports Rails 5.0+ but does not require it.
33
+ Sidekiq 7.0 supports Rails 6.0+ but does not require it.
38
34
 
39
35
 
40
36
  Installation
41
37
  -----------------
42
38
 
43
- gem install sidekiq
39
+ bundle add sidekiq
44
40
 
45
41
 
46
42
  Getting Started
47
43
  -----------------
48
44
 
49
45
  See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
50
- 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
51
47
  Sidekiq and see its features in action. Here's the Web UI:
52
48
 
53
- ![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)
54
50
 
55
51
 
56
52
  Want to Upgrade?
57
53
  -------------------
58
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
+
59
58
  I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
60
59
  features, a commercial-friendly license and allow you to support high
61
60
  quality open source development all at the same time. Please see the
62
61
  [Sidekiq](https://sidekiq.org/) homepage for more detail.
63
62
 
64
- Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
65
- features and changes to Sidekiq and its bigger siblings.
66
-
67
63
 
68
64
  Problems?
69
65
  -----------------
70
66
 
71
- **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.
72
69
 
73
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.
74
71
  Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
75
72
 
76
- Sidekiq Pro and Sidekiq Enterprise customers get private email support. You can purchase at https://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.
77
75
 
78
76
  Useful resources:
79
77
 
@@ -81,17 +79,21 @@ Useful resources:
81
79
  * Occasional announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
82
80
  * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q &amp; A.
83
81
 
84
- Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
82
+ Every Friday morning is Sidekiq office hour: I video chat and answer questions.
85
83
  See the [Sidekiq support page](https://sidekiq.org/support.html) for details.
86
84
 
85
+ Contributing
86
+ -----------------
87
+
88
+ Please see [the contributing guidelines](https://github.com/mperham/sidekiq/blob/main/.github/contributing.md).
87
89
 
88
90
  License
89
91
  -----------------
90
92
 
91
- Please see [LICENSE](https://github.com/mperham/sidekiq/blob/master/LICENSE) for licensing details.
92
-
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).
93
95
 
94
96
  Author
95
97
  -----------------
96
98
 
97
- Mike Perham, [@mperham@mastodon.xyz](https://mastodon.xyz/@mperham) / [@sidekiq](https://twitter.com/sidekiq), [https://www.mikeperham.com](https://www.mikeperham.com) / [https://www.contribsys.com](https://www.contribsys.com)
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)
data/bin/sidekiq CHANGED
@@ -4,15 +4,34 @@
4
4
  # RUBYOPT=-w bundle exec sidekiq
5
5
  $TESTING = false
6
6
 
7
- require_relative '../lib/sidekiq/cli'
7
+ require_relative "../lib/sidekiq/cli"
8
+
9
+ def integrate_with_systemd
10
+ return unless ENV["NOTIFY_SOCKET"]
11
+
12
+ Sidekiq.configure_server do |config|
13
+ config.logger.info "Enabling systemd notification integration"
14
+ require "sidekiq/sd_notify"
15
+ config.on(:startup) do
16
+ Sidekiq::SdNotify.ready
17
+ end
18
+ config.on(:shutdown) do
19
+ Sidekiq::SdNotify.stopping
20
+ end
21
+ Sidekiq.start_watchdog if Sidekiq::SdNotify.watchdog?
22
+ end
23
+ end
8
24
 
9
25
  begin
10
26
  cli = Sidekiq::CLI.instance
11
27
  cli.parse
28
+
29
+ integrate_with_systemd
30
+
12
31
  cli.run
13
32
  rescue => e
14
33
  raise e if $DEBUG
15
- STDERR.puts e.message
16
- STDERR.puts e.backtrace.join("\n")
34
+ warn e.message
35
+ warn e.backtrace.join("\n")
17
36
  exit 1
18
37
  end