sidekiq 5.2.10 → 7.2.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/Changes.md +600 -8
  3. data/LICENSE.txt +9 -0
  4. data/README.md +47 -50
  5. data/bin/sidekiq +22 -3
  6. data/bin/sidekiqload +213 -115
  7. data/bin/sidekiqmon +11 -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 +557 -354
  13. data/lib/sidekiq/capsule.rb +127 -0
  14. data/lib/sidekiq/cli.rb +204 -226
  15. data/lib/sidekiq/client.rb +127 -102
  16. data/lib/sidekiq/component.rb +68 -0
  17. data/lib/sidekiq/config.rb +287 -0
  18. data/lib/sidekiq/deploy.rb +62 -0
  19. data/lib/sidekiq/embedded.rb +61 -0
  20. data/lib/sidekiq/fetch.rb +49 -42
  21. data/lib/sidekiq/job.rb +374 -0
  22. data/lib/sidekiq/job_logger.rb +33 -7
  23. data/lib/sidekiq/job_retry.rb +147 -108
  24. data/lib/sidekiq/job_util.rb +107 -0
  25. data/lib/sidekiq/launcher.rb +203 -105
  26. data/lib/sidekiq/logger.rb +131 -0
  27. data/lib/sidekiq/manager.rb +43 -46
  28. data/lib/sidekiq/metrics/query.rb +155 -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 +113 -56
  32. data/lib/sidekiq/middleware/current_attributes.rb +95 -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 +146 -0
  36. data/lib/sidekiq/paginator.rb +28 -16
  37. data/lib/sidekiq/processor.rb +122 -120
  38. data/lib/sidekiq/rails.rb +48 -38
  39. data/lib/sidekiq/redis_client_adapter.rb +111 -0
  40. data/lib/sidekiq/redis_connection.rb +39 -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 +90 -89
  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 +186 -79
  51. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  52. data/lib/sidekiq/web/helpers.rb +154 -115
  53. data/lib/sidekiq/web/router.rb +23 -19
  54. data/lib/sidekiq/web.rb +68 -107
  55. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  56. data/lib/sidekiq.rb +92 -182
  57. data/sidekiq.gemspec +25 -16
  58. data/web/assets/images/apple-touch-icon.png +0 -0
  59. data/web/assets/javascripts/application.js +146 -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 +182 -0
  64. data/web/assets/javascripts/dashboard.js +35 -293
  65. data/web/assets/javascripts/metrics.js +298 -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 +111 -522
  69. data/web/locales/ar.yml +71 -65
  70. data/web/locales/cs.yml +62 -62
  71. data/web/locales/da.yml +60 -53
  72. data/web/locales/de.yml +65 -53
  73. data/web/locales/el.yml +43 -24
  74. data/web/locales/en.yml +86 -66
  75. data/web/locales/es.yml +70 -54
  76. data/web/locales/fa.yml +65 -65
  77. data/web/locales/fr.yml +83 -62
  78. data/web/locales/gd.yml +99 -0
  79. data/web/locales/he.yml +65 -64
  80. data/web/locales/hi.yml +59 -59
  81. data/web/locales/it.yml +53 -53
  82. data/web/locales/ja.yml +75 -64
  83. data/web/locales/ko.yml +52 -52
  84. data/web/locales/lt.yml +83 -0
  85. data/web/locales/nb.yml +61 -61
  86. data/web/locales/nl.yml +52 -52
  87. data/web/locales/pl.yml +45 -45
  88. data/web/locales/pt-br.yml +83 -55
  89. data/web/locales/pt.yml +51 -51
  90. data/web/locales/ru.yml +68 -63
  91. data/web/locales/sv.yml +53 -53
  92. data/web/locales/ta.yml +60 -60
  93. data/web/locales/uk.yml +62 -61
  94. data/web/locales/ur.yml +64 -64
  95. data/web/locales/vi.yml +83 -0
  96. data/web/locales/zh-cn.yml +43 -16
  97. data/web/locales/zh-tw.yml +42 -8
  98. data/web/views/_footer.erb +6 -3
  99. data/web/views/_job_info.erb +21 -4
  100. data/web/views/_metrics_period_select.erb +12 -0
  101. data/web/views/_nav.erb +1 -1
  102. data/web/views/_paging.erb +2 -0
  103. data/web/views/_poll_link.erb +3 -6
  104. data/web/views/_summary.erb +7 -7
  105. data/web/views/busy.erb +77 -27
  106. data/web/views/dashboard.erb +48 -18
  107. data/web/views/dead.erb +3 -3
  108. data/web/views/filtering.erb +7 -0
  109. data/web/views/layout.erb +3 -1
  110. data/web/views/metrics.erb +91 -0
  111. data/web/views/metrics_for_job.erb +59 -0
  112. data/web/views/morgue.erb +14 -15
  113. data/web/views/queue.erb +33 -24
  114. data/web/views/queues.erb +19 -5
  115. data/web/views/retries.erb +16 -17
  116. data/web/views/retry.erb +3 -3
  117. data/web/views/scheduled.erb +17 -15
  118. metadata +71 -71
  119. data/.circleci/config.yml +0 -61
  120. data/.github/contributing.md +0 -32
  121. data/.github/issue_template.md +0 -11
  122. data/.gitignore +0 -15
  123. data/.travis.yml +0 -11
  124. data/3.0-Upgrade.md +0 -70
  125. data/4.0-Upgrade.md +0 -53
  126. data/5.0-Upgrade.md +0 -56
  127. data/COMM-LICENSE +0 -97
  128. data/Ent-Changes.md +0 -238
  129. data/Gemfile +0 -19
  130. data/LICENSE +0 -9
  131. data/Pro-2.0-Upgrade.md +0 -138
  132. data/Pro-3.0-Upgrade.md +0 -44
  133. data/Pro-4.0-Upgrade.md +0 -35
  134. data/Pro-Changes.md +0 -759
  135. data/Rakefile +0 -9
  136. data/bin/sidekiqctl +0 -20
  137. data/code_of_conduct.md +0 -50
  138. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  139. data/lib/sidekiq/core_ext.rb +0 -1
  140. data/lib/sidekiq/ctl.rb +0 -221
  141. data/lib/sidekiq/delay.rb +0 -42
  142. data/lib/sidekiq/exception_handler.rb +0 -29
  143. data/lib/sidekiq/extensions/action_mailer.rb +0 -57
  144. data/lib/sidekiq/extensions/active_record.rb +0 -40
  145. data/lib/sidekiq/extensions/class_methods.rb +0 -40
  146. data/lib/sidekiq/extensions/generic_proxy.rb +0 -31
  147. data/lib/sidekiq/logging.rb +0 -122
  148. data/lib/sidekiq/middleware/server/active_record.rb +0 -23
  149. data/lib/sidekiq/util.rb +0 -66
  150. data/lib/sidekiq/worker.rb +0 -220
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22b205223a123bbe3a8812f1e2804be148afb5fe91c201ecb9a073eb4a188a06
4
- data.tar.gz: '08ab2999267df91afb8f62b9a6b00810299791cad99763d5b16f70bda946410a'
3
+ metadata.gz: 30f824346db9b0ebf8ee13c6ac0101494e5fd6d05b4ed2ef3ad97c5b17ccbc10
4
+ data.tar.gz: bed22f02925116256550bbc34ef9decd70bdbca356d5d61abedd4d14a7dcac45
5
5
  SHA512:
6
- metadata.gz: ad90b8ed3b060ce4521326a0dd4173550ee6bf64b0674fc08fbf37770aaec5ca0ea82738ed1730ccfcff4e0b616afcc47789ca8610cdd41a20abc0ef7d734891
7
- data.tar.gz: 2ed367f9801d28616a1b56b0b209cfe797c2b5a137d2e67cfb8c6864c8d5ed8f58992924ddce654f1fec53b84a5f18abdf88d4df45373b98f46786d511bac3f2
6
+ metadata.gz: 347e82cf6f215a1e4bd09c3f12d382be79d96bb83ccd1d09f928db19b936c2dd72c0f2e3a8988160086da7928a7911d84eddd005428c7b6a337763c4b60a3492
7
+ data.tar.gz: ef0a03f45d4d35e832f36b7a09ae0694838cd0cf3582dc20d53956bb5a61ba07811d410600b43a9bdf777e68dd2549910a125d23885afca8388b8513bb7ac8d1
data/Changes.md CHANGED
@@ -1,6 +1,598 @@
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.2.0
6
+ ----------
7
+
8
+ - `sidekiq_retries_exhausted` can return `:discard` to avoid the deadset
9
+ and all death handlers [#6091]
10
+ - Metrics filtering by job class in Web UI [#5974]
11
+ - Better readability and formatting for numbers within the Web UI [#6080]
12
+ - Add explicit error if user code tries to nest test modes [#6078]
13
+ ```ruby
14
+ Sidekiq::Testing.inline! # global setting
15
+ Sidekiq::Testing.fake! do # override within block
16
+ # ok
17
+ Sidekiq::Testing.inline! do # can't override the override
18
+ # not ok, nested
19
+ end
20
+ end
21
+ ```
22
+ - **SECURITY** Forbid inline JavaScript execution in Web UI [#6074]
23
+ - Adjust redis-client adapter to avoid `method_missing` [#6083]
24
+ This can result in app code breaking if your app's Redis API usage was
25
+ depending on Sidekiq's adapter to correct invalid redis-client API usage.
26
+ One example:
27
+ ```ruby
28
+ # bad, not redis-client native
29
+ # Unsupported command argument type: TrueClass (TypeError)
30
+ Sidekiq.redis { |c| c.set("key", "value", nx: true, ex: 15) }
31
+ # good
32
+ Sidekiq.redis { |c| c.set("key", "value", "nx", "ex", 15) }
33
+ ```
34
+
35
+ 7.1.6
36
+ ----------
37
+
38
+ - The block forms of testing modes (inline, fake) are now thread-safe so you can have
39
+ a multithreaded test suite which uses different modes for different tests. [#6069]
40
+ - Fix breakage with non-Proc error handlers [#6065]
41
+
42
+ 7.1.5
43
+ ----------
44
+
45
+ - **FEATURE**: Job filtering within the Web UI. This feature has been open
46
+ sourced from Sidekiq Pro. [#6052]
47
+ - **API CHANGE** Error handlers now take three arguments `->(ex, context, config)`.
48
+ The previous calling convention will work until Sidekiq 8.0 but will print
49
+ out a deprecation warning. [#6051]
50
+ - Fix issue with the `batch_size` and `at` options in `S::Client.push_bulk` [#6040]
51
+ - Fix inline testing firing batch callbacks early [#6057]
52
+ - Use new log broadcast API in Rails 7.1 [#6054]
53
+ - Crash if user tries to use RESP2 `protocol: 2` [#6061]
54
+
55
+ 7.1.4
56
+ ----------
57
+
58
+ - Fix empty `retry_for` logic [#6035]
59
+
60
+ 7.1.3
61
+ ----------
62
+
63
+ - Add `sidekiq_options retry_for: 48.hours` to allow time-based retry windows [#6029]
64
+ - Support sidekiq_retry_in and sidekiq_retries_exhausted_block in ActiveJobs (#5994)
65
+ - Lowercase all Rack headers for Rack 3.0 [#5951]
66
+ - Validate Sidekiq::Web page refresh delay to avoid potential DoS,
67
+ CVE-2023-26141, thanks for reporting Keegan!
68
+
69
+ 7.1.2
70
+ ----------
71
+
72
+ - Mark Web UI assets as private so CDNs won't cache them [#5936]
73
+ - Fix stackoverflow when using Oj and the JSON log formatter [#5920]
74
+ - Remove spurious `enqueued_at` from scheduled ActiveJobs [#5937]
75
+
76
+ 7.1.1
77
+ ----------
78
+
79
+ - Support multiple CurrentAttributes [#5904]
80
+ - Speed up latency fetch with large queues on Redis <7 [#5910]
81
+ - Allow a larger default client pool [#5886]
82
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
83
+
84
+ 7.1.0
85
+ ----------
86
+
87
+ - Improve display of ActiveJob arguments in Web UI [#5825, cover]
88
+ - Update `push_bulk` to push `batch_size` jobs at a time and allow laziness [#5827, fatkodima]
89
+ This allows Sidekiq::Client to push unlimited jobs as long as it has enough memory for the batch_size.
90
+ - Update `perform_bulk` to use `push_bulk` internally.
91
+ - Change return value of `push_bulk` to map 1-to-1 with arguments.
92
+ If you call `push_bulk(args: [[1], [2], [3]])`, you will now always get
93
+ an array of 3 values as the result: `["jid1", nil, "jid3"]` where nil means
94
+ that particular job did not push successfully (possibly due to middleware
95
+ stopping it). Previously nil values were removed so it was impossible to tell
96
+ which jobs pushed successfully and which did not.
97
+ - Migrate away from all deprecated Redis commands [#5788]
98
+ Sidekiq will now print a warning if you use one of those deprecated commands.
99
+ - Prefix all Sidekiq thread names [#5872]
100
+
101
+ 7.0.9
102
+ ----------
103
+
104
+ - Restore confirmation dialogs in Web UI [#5881, shevaun]
105
+ - Increase fetch timeout to minimize ReadTimeoutError [#5874]
106
+ - Reverse histogram tooltip ordering [#5868]
107
+ - Add Scottish Gaelic (gd) locale [#5867, GunChleoc]
108
+
109
+ 7.0.8
110
+ ----------
111
+
112
+ - **SECURITY** Sanitize `period` input parameter on Metrics pages.
113
+ Specially crafted values can lead to XSS. This functionality
114
+ was introduced in 7.0.4. Thank you to spercex @ huntr.dev [#5694]
115
+ - Add job hash as 3rd parameter to the `sidekiq_retry_in` block.
116
+
117
+ 7.0.7
118
+ ----------
119
+
120
+ - Fix redis-client API usage which could result in stuck Redis
121
+ connections [#5823]
122
+ - Fix AS::Duration with `sidekiq_retry_in` [#5806]
123
+ - Restore dumping config options on startup with `-v` [#5822]
124
+
125
+ 7.0.5,7.0.6
126
+ ----------
127
+
128
+ - More context for debugging json unsafe errors [#5787]
129
+
130
+ 7.0.4
131
+ ----------
132
+
133
+ - Performance and memory optimizations [#5768, fatkodima]
134
+ - Add 1-8 hour period selector to Metrics pages [#5694]
135
+ - Fix process display with `sidekiqmon` [#5733]
136
+
137
+ 7.0.3
138
+ ----------
139
+
140
+ - Don't warn about memory policy on Redis Enterprise [#5712]
141
+ - Don't allow Quiet/Stop on embedded Sidekiq instances [#5716]
142
+ - Fix `size: X` for configuring the default Redis pool size [#5702]
143
+ - Improve the display of queue weights on Busy page [#5642]
144
+ - Freeze CurrentAttributes on a job once initially set [#5692]
145
+
146
+ 7.0.2
147
+ ----------
148
+
149
+ - Improve compatibility with custom loggers [#5673]
150
+ - Add queue weights on Busy page [#5640]
151
+ - Add BID link on job_info page if job is part of a Batch [#5623]
152
+ - Allow custom extensions to add rows/links within Job detail pages [#5624]
153
+ ```ruby
154
+ Sidekiq::Web.custom_job_info_rows << AddAccountLink.new
155
+
156
+ class AddAccountLink
157
+ include CGI::Util
158
+ def add_pair(job)
159
+ # yield a (name, value) pair
160
+ # You can include HTML tags and CSS, Sidekiq does not do any
161
+ # escaping so beware user data injection! Note how we use CGI's
162
+ # `h` escape helper.
163
+ aid = job["account_id"]
164
+ yield "Account", "<a href='/accounts/#{h aid}'>#{h aid}</a>" if aid
165
+ end
166
+ end
167
+ ```
168
+
169
+ 7.0.1
170
+ ----------
171
+
172
+ - Allow an embedding process to reuse its own heartbeat thread
173
+ - Update zh-cn localization
174
+
175
+ 7.0.0
176
+ ----------
177
+
178
+ - Embedded mode!
179
+ - Capsules!!
180
+ - Job Execution metrics!!!
181
+ - See `docs/7.0-Upgrade.md` for release notes
182
+
183
+ 6.5.{10,11,12}
184
+ ----------
185
+
186
+ - Fixes for Rails 7.1 [#6067, #6070]
187
+
188
+ 6.5.9
189
+ ----------
190
+
191
+ - Ensure Sidekiq.options[:environment] == RAILS_ENV [#5932]
192
+
193
+ 6.5.8
194
+ ----------
195
+
196
+ - Fail if using a bad version of scout_apm [#5616]
197
+ - Add pagination to Busy page [#5556]
198
+ - Speed up WorkSet#each [#5559]
199
+ - Adjust CurrentAttributes to work with the String class name so we aren't referencing the Class within a Rails initializer [#5536]
200
+
201
+ 6.5.7
202
+ ----------
203
+
204
+ - Updates for JA and ZH locales
205
+ - Further optimizations for scheduled polling [#5513]
206
+
207
+ 6.5.6
208
+ ----------
209
+
210
+ - Fix deprecation warnings with redis-rb 4.8.0 [#5484]
211
+ - Lock redis-rb to < 5.0 as we are moving to redis-client in Sidekiq 7.0
212
+
213
+ 6.5.5
214
+ ----------
215
+
216
+ - Fix require issue with job_retry.rb [#5462]
217
+ - Improve Sidekiq::Web compatibility with Rack 3.x
218
+
219
+ 6.5.4
220
+ ----------
221
+
222
+ - Fix invalid code on Ruby 2.5 [#5460]
223
+ - Fix further metrics dependency issues [#5457]
224
+
225
+ 6.5.3
226
+ ----------
227
+
228
+ - Don't require metrics code without explicit opt-in [#5456]
229
+
230
+ 6.5.2
231
+ ----------
232
+
233
+ - [Job Metrics are under active development, help wanted!](https://github.com/sidekiq/sidekiq/wiki/Metrics#contributing) **BETA**
234
+ - Add `Context` column on queue page which shows any CurrentAttributes [#5450]
235
+ - `sidekiq_retry_in` may now return `:discard` or `:kill` to dynamically stop job retries [#5406]
236
+ - Smarter sorting of processes in /busy Web UI [#5398]
237
+ - Fix broken hamburger menu in mobile UI [#5428]
238
+ - Require redis-rb 4.5.0. Note that Sidekiq will break if you use the
239
+ [`Redis.exists_returns_integer = false`](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#450) flag. [#5394]
240
+
241
+ 6.5.1
242
+ ----------
243
+
244
+ - Fix `push_bulk` breakage [#5387]
245
+
246
+ 6.5.0
247
+ ---------
248
+
249
+ - Substantial refactoring of Sidekiq server internals, part of a larger effort
250
+ 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).
251
+ - **Add beta support for the `redis-client` gem**. This will become the default Redis driver in Sidekiq 7.0. [#5298]
252
+ Read more: https://github.com/sidekiq/sidekiq/wiki/Using-redis-client
253
+ - **Add beta support for DB transaction-aware client** [#5291]
254
+ Add this line to your initializer and any jobs created during a transaction
255
+ will only be pushed to Redis **after the transaction commits**. You will need to add the
256
+ `after_commit_everywhere` gem to your Gemfile.
257
+ ```ruby
258
+ Sidekiq.transactional_push!
259
+ ```
260
+ This feature does not have a lot of production usage yet; please try it out and let us
261
+ know if you have any issues. It will be fully supported in Sidekiq 7.0 or removed if it
262
+ proves problematic.
263
+ - Fix regression with middleware arguments [#5312]
264
+
265
+ 6.4.2
266
+ ---------
267
+
268
+ - Strict argument checking now runs after client-side middleware [#5246]
269
+ - Fix page events with live polling [#5184]
270
+ - Many under-the-hood changes to remove all usage of the term "worker"
271
+ from the Sidekiq codebase and APIs. This mostly involved RDoc and local
272
+ variable names but a few constants and public APIs were changed. The old
273
+ APIs will be removed in Sidekiq 7.0.
274
+ ```
275
+ Sidekiq::DEFAULT_WORKER_OPTIONS -> Sidekiq.default_job_options
276
+ Sidekiq.default_worker_options -> Sidekiq.default_job_options
277
+ Sidekiq::Queues["default"].jobs_by_worker(HardJob) -> Sidekiq::Queues["default"].jobs_by_class(HardJob)
278
+ ```
279
+
280
+ 6.4.1
281
+ ---------
282
+
283
+ - Fix pipeline/multi deprecations in redis-rb 4.6
284
+ - Fix sidekiq.yml YAML load errors on Ruby 3.1 [#5141]
285
+ - Sharding support for `perform_bulk` [#5129]
286
+ - Refactor job logger for SPEEEEEEED
287
+
288
+ 6.4.0
289
+ ---------
290
+
291
+ - **SECURITY**: Validate input to avoid possible DoS in Web UI.
292
+ - Add **strict argument checking** [#5071]
293
+ Sidekiq will now log a warning if JSON-unsafe arguments are passed to `perform_async`.
294
+ Add `Sidekiq.strict_args!(false)` to your initializer to disable this warning.
295
+ This warning will switch to an exception in Sidekiq 7.0.
296
+ - Note that Delayed Extensions will be removed in Sidekiq 7.0 [#5076]
297
+ - Add `perform_{inline,sync}` in Sidekiq::Job to run a job synchronously [#5061, hasan-ally]
298
+ ```ruby
299
+ SomeJob.perform_async(args...)
300
+ SomeJob.perform_sync(args...)
301
+ SomeJob.perform_inline(args...)
302
+ ```
303
+ You can also dynamically redirect a job to run synchronously:
304
+ ```ruby
305
+ SomeJob.set("sync": true).perform_async(args...) # will run via perform_inline
306
+ ```
307
+ - Replace Sidekiq::Worker `app/workers` generator with Sidekiq::Job `app/sidekiq` generator [#5055]
308
+ ```
309
+ bin/rails generate sidekiq:job ProcessOrderJob
310
+ ```
311
+ - Fix job retries losing CurrentAttributes [#5090]
312
+ - Tweak shutdown to give long-running threads time to cleanup [#5095]
313
+
314
+ 6.3.1
315
+ ---------
316
+
317
+ - Fix keyword arguments error with CurrentAttributes on Ruby 3.0 [#5048]
318
+
319
+ 6.3.0
320
+ ---------
321
+
322
+ - **BREAK**: The Web UI has been refactored to remove jQuery. Any UI extensions
323
+ which use jQuery will break.
324
+ - **FEATURE**: Sidekiq.logger has been enhanced so any `Rails.logger`
325
+ output in jobs now shows up in the Sidekiq console. Remove any logger
326
+ hacks in your initializer and see if it Just Works™ now. [#5021]
327
+ - **FEATURE**: Add `Sidekiq::Job` alias for `Sidekiq::Worker`, to better
328
+ reflect industry standard terminology. You can now do this:
329
+ ```ruby
330
+ class MyJob
331
+ include Sidekiq::Job
332
+ sidekiq_options ...
333
+ def perform(args)
334
+ end
335
+ end
336
+ ```
337
+ - **FEATURE**: Support for serializing ActiveSupport::CurrentAttributes into each job. [#4982]
338
+ ```ruby
339
+ # config/initializers/sidekiq.rb
340
+ require "sidekiq/middleware/current_attributes"
341
+ Sidekiq::CurrentAttributes.persist(Myapp::Current) # Your AS::CurrentAttributes singleton
342
+ ```
343
+ - **FEATURE**: Add `Sidekiq::Worker.perform_bulk` for enqueuing jobs in bulk,
344
+ similar to `Sidekiq::Client.push_bulk` [#5042]
345
+ ```ruby
346
+ MyJob.perform_bulk([[1], [2], [3]])
347
+ ```
348
+ - Implement `queue_as`, `wait` and `wait_until` for ActiveJob compatibility [#5003]
349
+ - Scheduler now uses Lua to reduce Redis load and network roundtrips [#5044]
350
+ - Retry Redis operation if we get an `UNBLOCKED` Redis error [#4985]
351
+ - Run existing signal traps, if any, before running Sidekiq's trap [#4991]
352
+ - Fix fetch bug when using weighted queues which caused Sidekiq to stop
353
+ processing queues randomly [#5031]
354
+
355
+ 6.2.2
356
+ ---------
357
+
358
+ - Reduce retry jitter, add jitter to `sidekiq_retry_in` values [#4957]
359
+ - Minimize scheduler load on Redis at scale [#4882]
360
+ - Improve logging of delay jobs [#4904, BuonOno]
361
+ - Minor CSS improvements for buttons and tables, design PRs always welcome!
362
+ - Tweak Web UI `Cache-Control` header [#4966]
363
+ - Rename internal API class `Sidekiq::Job` to `Sidekiq::JobRecord` [#4955]
364
+
365
+ 6.2.1
366
+ ---------
367
+
368
+ - Update RTT warning logic to handle transient RTT spikes [#4851]
369
+ - Fix very low priority CVE on unescaped queue name [#4852]
370
+ - Add note about sessions and Rails apps in API mode
371
+
372
+ 6.2.0
373
+ ---------
374
+
375
+ - Store Redis RTT and log if poor [#4824]
376
+ - Add process/thread stats to Busy page [#4806]
377
+ - Improve Web UI on mobile devices [#4840]
378
+ - **Refactor Web UI session usage** [#4804]
379
+ Numerous people have hit "Forbidden" errors and struggled with Sidekiq's
380
+ Web UI session requirement. If you have code in your initializer for
381
+ Web sessions, it's quite possible it will need to be removed. Here's
382
+ an overview:
383
+ ```
384
+ Sidekiq::Web needs a valid Rack session for CSRF protection. If this is a Rails app,
385
+ make sure you mount Sidekiq::Web *inside* your routes in `config/routes.rb` so
386
+ Sidekiq can reuse the Rails session:
387
+
388
+ Rails.application.routes.draw do
389
+ mount Sidekiq::Web => "/sidekiq"
390
+ ....
391
+ end
392
+
393
+ If this is a bare Rack app, use a session middleware before Sidekiq::Web:
394
+
395
+ # first, use IRB to create a shared secret key for sessions and commit it
396
+ require 'securerandom'; File.open(".session.key", "w") {|f| f.write(SecureRandom.hex(32)) }
397
+
398
+ # now, update your Rack app to include the secret with a session cookie middleware
399
+ use Rack::Session::Cookie, secret: File.read(".session.key"), same_site: true, max_age: 86400
400
+ run Sidekiq::Web
401
+
402
+ If this is a Rails app in API mode, you need to enable sessions.
403
+
404
+ https://guides.rubyonrails.org/api_app.html#using-session-middlewares
405
+ ```
406
+
407
+ 6.1.3
408
+ ---------
409
+
410
+ - Warn if Redis is configured to evict data under memory pressure [#4752]
411
+ - Add process RSS on the Busy page [#4717]
412
+
413
+ 6.1.2
414
+ ---------
415
+
416
+ - Improve readability in dark mode Web UI [#4674]
417
+ - Fix Web UI crash with corrupt session [#4672]
418
+ - Allow middleware to yield arguments [#4673, @eugeneius]
419
+ - Migrate CI from CircleCI to GitHub Actions [#4677]
420
+
421
+ 6.1.1
422
+ ---------
423
+
424
+ - Jobs are now sorted by age in the Busy Workers table. [#4641]
425
+ - Fix "check all" JS logic in Web UI [#4619]
426
+
427
+ 6.1.0
428
+ ---------
429
+
430
+ - Web UI - Dark Mode fixes [#4543, natematykiewicz]
431
+ - Ensure `Rack::ContentLength` is loaded as middleware for correct Web UI responses [#4541]
432
+ - Avoid exception dumping SSL store in Redis connection logging [#4532]
433
+ - Better error messages in Sidekiq::Client [#4549]
434
+ - Remove rack-protection, reimplement CSRF protection [#4588]
435
+ - Require redis-rb 4.2 [#4591]
436
+ - Update to jquery 1.12.4 [#4593]
437
+ - Refactor internal fetch logic and API [#4602]
438
+
439
+ 6.0.7
440
+ ---------
441
+
442
+ - Refactor systemd integration to work better with custom binaries [#4511]
443
+ - Don't connect to Redis at process exit if not needed [#4502]
444
+ - Remove Redis connection naming [#4479]
445
+ - Fix Redis Sentinel password redaction [#4499]
446
+ - Add Vietnamese locale (vi) [#4528]
447
+
448
+ 6.0.6
449
+ ---------
450
+
451
+ - **Integrate with systemd's watchdog and notification features** [#4488]
452
+ Set `Type=notify` in [sidekiq.service](https://github.com/sidekiq/sidekiq/blob/4b8a8bd3ae42f6e48ae1fdaf95ed7d7af18ed8bb/examples/systemd/sidekiq.service#L30-L39). The integration works automatically.
453
+ - Use `setTimeout` rather than `setInterval` to avoid thundering herd [#4480]
454
+ - Fix edge case where a job can be pushed without a queue.
455
+ - Flush job stats at exit [#4498]
456
+ - Check RAILS_ENV before RACK_ENV [#4493]
457
+ - Add Lithuanian locale [#4476]
458
+
459
+ 6.0.5
460
+ ---------
461
+
462
+ - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
463
+ - Update APIs to use `UNLINK`, not `DEL`. [#4449]
464
+ - Fix Ruby 2.7 warnings [#4412]
465
+ - Add support for `APP_ENV` [[95fa5d9]](https://github.com/sidekiq/sidekiq/commit/95fa5d90192148026e52ca2902f1b83c70858ce8)
466
+
467
+ 6.0.4
468
+ ---------
469
+
470
+ - Fix ActiveJob's `sidekiq_options` integration [#4404]
471
+ - Sidekiq Pro users will now see a Pause button next to each queue in
472
+ the Web UI, allowing them to pause queues manually [#4374, shayonj]
473
+ - Fix Sidekiq::Workers API unintentional change in 6.0.2 [#4387]
474
+
475
+
476
+ 6.0.3
477
+ ---------
478
+
479
+ - Fix `Sidekiq::Client.push_bulk` API which was erroneously putting
480
+ invalid `at` values in the job payloads [#4321]
481
+
482
+ 6.0.2
483
+ ---------
484
+
485
+ - Fix Sidekiq Enterprise's rolling restart functionality, broken by refactoring in 6.0.0. [#4334]
486
+ - More internal refactoring and performance tuning [fatkodima]
487
+
488
+ 6.0.1
489
+ ---------
490
+
491
+ - **Performance tuning**, Sidekiq should be 10-15% faster now [#4303, 4299,
492
+ 4269, fatkodima]
493
+ - **Dark Mode support in Web UI** (further design polish welcome!) [#4227, mperham,
494
+ fatkodima, silent-e]
495
+ - **Job-specific log levels**, allowing you to turn on debugging for
496
+ problematic workers. [fatkodima, #4287]
497
+ ```ruby
498
+ MyWorker.set(log_level: :debug).perform_async(...)
499
+ ```
500
+ - **Ad-hoc job tags**. You can tag your jobs with, e.g, subdomain, tenant, country,
501
+ locale, application, version, user/client, "alpha/beta/pro/ent", types of jobs,
502
+ teams/people responsible for jobs, additional metadata, etc.
503
+ Tags are shown on different pages with job listings. Sidekiq Pro users
504
+ can filter based on them [fatkodima, #4280]
505
+ ```ruby
506
+ class MyWorker
507
+ include Sidekiq::Worker
508
+ sidekiq_options tags: ['bank-ops', 'alpha']
509
+ ...
510
+ end
511
+ ```
512
+ - Fetch scheduled jobs in batches before pushing into specific queues.
513
+ This will decrease enqueueing time of scheduled jobs by a third. [fatkodima, #4273]
514
+ ```
515
+ ScheduledSet with 10,000 jobs
516
+ Before: 56.6 seconds
517
+ After: 39.2 seconds
518
+ ```
519
+ - Compress error backtraces before pushing into Redis, if you are
520
+ storing error backtraces, this will halve the size of your RetrySet
521
+ in Redis [fatkodima, #4272]
522
+ ```
523
+ RetrySet with 100,000 jobs
524
+ Before: 261 MB
525
+ After: 129 MB
526
+ ```
527
+ - Support display of ActiveJob 6.0 payloads in the Web UI [#4263]
528
+ - Add `SortedSet#scan` for pattern based scanning. For large sets this API will be **MUCH** faster
529
+ than standard iteration using each. [fatkodima, #4262]
530
+ ```ruby
531
+ Sidekiq::DeadSet.new.scan("UnreliableApi") do |job|
532
+ job.retry
533
+ end
534
+ ```
535
+ - Dramatically speed up SortedSet#find\_job(jid) by using Redis's ZSCAN
536
+ support, approx 10x faster. [fatkodima, #4259]
537
+ ```
538
+ zscan 0.179366 0.047727 0.227093 ( 1.161376)
539
+ enum 8.522311 0.419826 8.942137 ( 9.785079)
540
+ ```
541
+ - Respect rails' generators `test_framework` option and gracefully handle extra `worker` suffix on generator [fatkodima, #4256]
542
+ - Add ability to sort 'Enqueued' page on Web UI by position in the queue [fatkodima, #4248]
543
+ - Support `Client.push_bulk` with different delays [fatkodima, #4243]
544
+ ```ruby
545
+ Sidekiq::Client.push_bulk("class" => FooJob, "args" => [[1], [2]], "at" => [1.minute.from_now.to_f, 5.minutes.from_now.to_f])
546
+ ```
547
+ - Easier way to test enqueuing specific ActionMailer and ActiveRecord delayed jobs. Instead of manually
548
+ parsing embedded class, you can now test by fetching jobs for specific classes. [fatkodima, #4292]
549
+ ```ruby
550
+ assert_equal 1, Sidekiq::Extensions::DelayedMailer.jobs_for(FooMailer).size
551
+ ```
552
+ - Add `sidekiqmon` to gemspec executables [#4242]
553
+ - Gracefully handle `Sidekiq.logger = nil` [#4240]
554
+ - Inject Sidekiq::LogContext module if user-supplied logger does not include it [#4239]
555
+
556
+ 6.0
557
+ ---------
558
+
559
+ This release has major breaking changes. Read and test carefully in production.
560
+
561
+ - With Rails 6.0.2+, ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
562
+ features/internals like the retry subsystem. [#4213, pirj]
563
+ ```ruby
564
+ class MyJob < ActiveJob::Base
565
+ queue_as :myqueue
566
+ sidekiq_options retry: 10, backtrace: 20
567
+ def perform(...)
568
+ end
569
+ end
570
+ ```
571
+ - Logging has been redesigned to allow for pluggable log formatters:
572
+ ```ruby
573
+ Sidekiq.configure_server do |config|
574
+ config.log_formatter = Sidekiq::Logger::Formatters::JSON.new
575
+ end
576
+ ```
577
+ See the [Logging wiki page](https://github.com/sidekiq/sidekiq/wiki/Logging) for more details.
578
+ - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
579
+ variable. This variable is meant to hold the name of the environment
580
+ variable which contains your Redis URL, so that you can switch Redis
581
+ providers quickly and easily with a single variable change. It is not
582
+ meant to hold the actual Redis URL itself. If you want to manually set
583
+ the Redis URL (not recommended as it implies you have no failover),
584
+ then you may set `REDIS_URL` directly. [#3969]
585
+ - **BREAKING CHANGE** Increase default shutdown timeout from 8 seconds
586
+ to 25 seconds. Both Heroku and ECS now use 30 second shutdown timeout
587
+ by default and we want Sidekiq to take advantage of this time. If you
588
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
589
+ get the old behavior. [#3968]
590
+ - **BREAKING CHANGE** Remove the daemonization, logfile and pidfile
591
+ arguments to Sidekiq. Use a proper process supervisor (e.g. systemd or
592
+ foreman) to manage Sidekiq. See the Deployment wiki page for links to
593
+ more resources.
594
+ - Integrate the StandardRB code formatter to ensure consistent code
595
+ styling. [#4114, gearnode]
4
596
 
5
597
  5.2.10
6
598
  ---------
@@ -174,7 +766,7 @@ Sidekiq::Middleware::Server::Logging -> Sidekiq::JobLogger
174
766
  - The `SomeWorker.set(options)` API was re-written to avoid thread-local state. [#2152]
175
767
  - Sidekiq Enterprise's encrypted jobs now display "[encrypted data]" in the Web UI instead
176
768
  of random hex bytes.
177
- - Please see the [5.0 Upgrade notes](5.0-Upgrade.md) for more detail.
769
+ - Please see the [5.0 Upgrade notes](docs/5.0-Upgrade.md) for more detail.
178
770
 
179
771
  4.2.10
180
772
  -----------
@@ -392,7 +984,7 @@ Sidekiq::Queues.clear_all
392
984
  - Sidekiq's internals have been completely overhauled for performance
393
985
  and to remove dependencies. This has resulted in major speedups, as
394
986
  [detailed on my blog](http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/).
395
- - See the [4.0 upgrade notes](4.0-Upgrade.md) for more detail.
987
+ - See the [4.0 upgrade notes](docs/4.0-Upgrade.md) for more detail.
396
988
 
397
989
  3.5.4
398
990
  -----------
@@ -429,7 +1021,7 @@ Sidekiq::Queues.clear_all
429
1021
  - **FIX MEMORY LEAK** Under rare conditions, threads may leak [#2598, gazay]
430
1022
  - Add Ukrainian locale [#2561, elrakita]
431
1023
  - Disconnect and retry Redis operations if we see a READONLY error [#2550]
432
- - Add server middleware testing harness; see [wiki](https://github.com/mperham/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
1024
+ - Add server middleware testing harness; see [wiki](https://github.com/sidekiq/sidekiq/wiki/Testing#testing-server-middleware) [#2534, ryansch]
433
1025
 
434
1026
  3.5.0
435
1027
  -----------
@@ -447,7 +1039,7 @@ Sidekiq::Queues.clear_all
447
1039
  - Fix CSRF vulnerability in Web UI, thanks to Egor Homakov for
448
1040
  reporting. [#2422] If you are running the Web UI as a standalone Rack app,
449
1041
  ensure you have a [session middleware
450
- configured](https://github.com/mperham/sidekiq/wiki/Monitoring#standalone):
1042
+ configured](https://github.com/sidekiq/sidekiq/wiki/Monitoring#standalone):
451
1043
  ```ruby
452
1044
  use Rack::Session::Cookie, :secret => "some unique secret string here"
453
1045
  ```
@@ -659,7 +1251,7 @@ sidekiq_options :dead => false, :retry => 5
659
1251
  3.0.0
660
1252
  -----------
661
1253
 
662
- Please see [3.0-Upgrade.md](3.0-Upgrade.md) for more comprehensive upgrade notes.
1254
+ Please see [3.0-Upgrade.md](docs/3.0-Upgrade.md) for more comprehensive upgrade notes.
663
1255
 
664
1256
  - **Dead Job Queue** - jobs which run out of retries are now moved to a dead
665
1257
  job queue. These jobs must be retried manually or they will expire
@@ -703,7 +1295,7 @@ Sidekiq::Client.via(ConnectionPool.new { Redis.new }) do
703
1295
  end
704
1296
  ```
705
1297
  **Sharding support does require a breaking change to client-side
706
- middleware, see 3.0-Upgrade.md.**
1298
+ middleware, see docs/3.0-Upgrade.md.**
707
1299
  - New Chinese, Greek, Swedish and Czech translations for the Web UI.
708
1300
  - Updated most languages translations for the new UI features.
709
1301
  - **Remove official Capistrano integration** - this integration has been
@@ -831,7 +1423,7 @@ middleware, see 3.0-Upgrade.md.**
831
1423
  appear to be doing any work. [#1194]
832
1424
  - Sidekiq's testing behavior is now dynamic. You can choose between
833
1425
  `inline` and `fake` behavior in your tests. See
834
- [Testing](https://github.com/mperham/sidekiq/wiki/Testing) for detail. [#1193]
1426
+ [Testing](https://github.com/sidekiq/sidekiq/wiki/Testing) for detail. [#1193]
835
1427
  - The Retries table has a new column for the error message.
836
1428
  - The Web UI topbar now contains the status and live poll button.
837
1429
  - 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.