sidekiq 5.2.6 → 7.1.0

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

Potentially problematic release.


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

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