sidekiq 6.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 (127) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +71 -0
  3. data/.github/contributing.md +32 -0
  4. data/.github/issue_template.md +11 -0
  5. data/.gitignore +13 -0
  6. data/.standard.yml +20 -0
  7. data/3.0-Upgrade.md +70 -0
  8. data/4.0-Upgrade.md +53 -0
  9. data/5.0-Upgrade.md +56 -0
  10. data/6.0-Upgrade.md +72 -0
  11. data/COMM-LICENSE +97 -0
  12. data/Changes.md +1718 -0
  13. data/Ent-2.0-Upgrade.md +37 -0
  14. data/Ent-Changes.md +269 -0
  15. data/Gemfile +24 -0
  16. data/Gemfile.lock +208 -0
  17. data/LICENSE +9 -0
  18. data/Pro-2.0-Upgrade.md +138 -0
  19. data/Pro-3.0-Upgrade.md +44 -0
  20. data/Pro-4.0-Upgrade.md +35 -0
  21. data/Pro-5.0-Upgrade.md +25 -0
  22. data/Pro-Changes.md +790 -0
  23. data/README.md +94 -0
  24. data/Rakefile +10 -0
  25. data/bin/sidekiq +42 -0
  26. data/bin/sidekiqload +157 -0
  27. data/bin/sidekiqmon +8 -0
  28. data/code_of_conduct.md +50 -0
  29. data/lib/generators/sidekiq/templates/worker.rb.erb +9 -0
  30. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +6 -0
  31. data/lib/generators/sidekiq/templates/worker_test.rb.erb +8 -0
  32. data/lib/generators/sidekiq/worker_generator.rb +57 -0
  33. data/lib/sidekiq.rb +262 -0
  34. data/lib/sidekiq/api.rb +960 -0
  35. data/lib/sidekiq/cli.rb +401 -0
  36. data/lib/sidekiq/client.rb +263 -0
  37. data/lib/sidekiq/delay.rb +41 -0
  38. data/lib/sidekiq/exception_handler.rb +27 -0
  39. data/lib/sidekiq/extensions/action_mailer.rb +47 -0
  40. data/lib/sidekiq/extensions/active_record.rb +43 -0
  41. data/lib/sidekiq/extensions/class_methods.rb +43 -0
  42. data/lib/sidekiq/extensions/generic_proxy.rb +31 -0
  43. data/lib/sidekiq/fetch.rb +82 -0
  44. data/lib/sidekiq/job_logger.rb +63 -0
  45. data/lib/sidekiq/job_retry.rb +262 -0
  46. data/lib/sidekiq/launcher.rb +206 -0
  47. data/lib/sidekiq/logger.rb +165 -0
  48. data/lib/sidekiq/manager.rb +135 -0
  49. data/lib/sidekiq/middleware/chain.rb +160 -0
  50. data/lib/sidekiq/middleware/i18n.rb +40 -0
  51. data/lib/sidekiq/monitor.rb +133 -0
  52. data/lib/sidekiq/paginator.rb +47 -0
  53. data/lib/sidekiq/processor.rb +280 -0
  54. data/lib/sidekiq/rails.rb +50 -0
  55. data/lib/sidekiq/redis_connection.rb +146 -0
  56. data/lib/sidekiq/scheduled.rb +173 -0
  57. data/lib/sidekiq/sd_notify.rb +149 -0
  58. data/lib/sidekiq/systemd.rb +24 -0
  59. data/lib/sidekiq/testing.rb +344 -0
  60. data/lib/sidekiq/testing/inline.rb +30 -0
  61. data/lib/sidekiq/util.rb +67 -0
  62. data/lib/sidekiq/version.rb +5 -0
  63. data/lib/sidekiq/web.rb +213 -0
  64. data/lib/sidekiq/web/action.rb +93 -0
  65. data/lib/sidekiq/web/application.rb +357 -0
  66. data/lib/sidekiq/web/csrf_protection.rb +153 -0
  67. data/lib/sidekiq/web/helpers.rb +333 -0
  68. data/lib/sidekiq/web/router.rb +101 -0
  69. data/lib/sidekiq/worker.rb +244 -0
  70. data/sidekiq.gemspec +20 -0
  71. data/web/assets/images/favicon.ico +0 -0
  72. data/web/assets/images/logo.png +0 -0
  73. data/web/assets/images/status.png +0 -0
  74. data/web/assets/javascripts/application.js +95 -0
  75. data/web/assets/javascripts/dashboard.js +296 -0
  76. data/web/assets/stylesheets/application-dark.css +133 -0
  77. data/web/assets/stylesheets/application-rtl.css +246 -0
  78. data/web/assets/stylesheets/application.css +1158 -0
  79. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  80. data/web/assets/stylesheets/bootstrap.css +5 -0
  81. data/web/locales/ar.yml +81 -0
  82. data/web/locales/cs.yml +78 -0
  83. data/web/locales/da.yml +68 -0
  84. data/web/locales/de.yml +81 -0
  85. data/web/locales/el.yml +68 -0
  86. data/web/locales/en.yml +83 -0
  87. data/web/locales/es.yml +70 -0
  88. data/web/locales/fa.yml +80 -0
  89. data/web/locales/fr.yml +78 -0
  90. data/web/locales/he.yml +79 -0
  91. data/web/locales/hi.yml +75 -0
  92. data/web/locales/it.yml +69 -0
  93. data/web/locales/ja.yml +83 -0
  94. data/web/locales/ko.yml +68 -0
  95. data/web/locales/lt.yml +83 -0
  96. data/web/locales/nb.yml +77 -0
  97. data/web/locales/nl.yml +68 -0
  98. data/web/locales/pl.yml +59 -0
  99. data/web/locales/pt-br.yml +68 -0
  100. data/web/locales/pt.yml +67 -0
  101. data/web/locales/ru.yml +78 -0
  102. data/web/locales/sv.yml +68 -0
  103. data/web/locales/ta.yml +75 -0
  104. data/web/locales/uk.yml +76 -0
  105. data/web/locales/ur.yml +80 -0
  106. data/web/locales/vi.yml +83 -0
  107. data/web/locales/zh-cn.yml +68 -0
  108. data/web/locales/zh-tw.yml +68 -0
  109. data/web/views/_footer.erb +20 -0
  110. data/web/views/_job_info.erb +89 -0
  111. data/web/views/_nav.erb +52 -0
  112. data/web/views/_paging.erb +23 -0
  113. data/web/views/_poll_link.erb +7 -0
  114. data/web/views/_status.erb +4 -0
  115. data/web/views/_summary.erb +40 -0
  116. data/web/views/busy.erb +101 -0
  117. data/web/views/dashboard.erb +75 -0
  118. data/web/views/dead.erb +34 -0
  119. data/web/views/layout.erb +41 -0
  120. data/web/views/morgue.erb +78 -0
  121. data/web/views/queue.erb +55 -0
  122. data/web/views/queues.erb +38 -0
  123. data/web/views/retries.erb +83 -0
  124. data/web/views/retry.erb +34 -0
  125. data/web/views/scheduled.erb +57 -0
  126. data/web/views/scheduled_job_info.erb +8 -0
  127. metadata +212 -0
data/LICENSE 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 has a commercial-friendly license allowing private forks
8
+ and modifications of Sidekiq. Please see https://sidekiq.org/products/pro.html for
9
+ more detail. You can find the commercial license terms in COMM-LICENSE.
@@ -0,0 +1,138 @@
1
+ # Upgrading to Sidekiq Pro 2.0
2
+
3
+ Sidekiq Pro 2.0 allows nested batches for more complex job workflows
4
+ and provides a new reliable scheduler which uses Lua to guarantee
5
+ atomicity and much higher performance.
6
+
7
+ It also removes deprecated APIs, changes the batch data format and
8
+ how features are activated. Read carefully to ensure your upgrade goes
9
+ smoothly.
10
+
11
+ Sidekiq Pro 2.0 requires Sidekiq 3.3.2 or greater. Redis 2.8 is
12
+ recommended; Redis 2.4 or 2.6 will work but some functionality will not be
13
+ available.
14
+
15
+ **Note that you CANNOT go back to Pro 1.x once you've created batches
16
+ with 2.x. The new batches will not process correctly with 1.x.**
17
+
18
+ **If you are on a version of Sidekiq Pro <1.5, you should upgrade to the
19
+ latest 1.x version and run it for a week before upgrading to 2.0.**
20
+
21
+ ## Nested Batches
22
+
23
+ Batches can now be nested within the `jobs` method.
24
+ This feature enables Sidekiq Pro to handle workflow processing of any size
25
+ and complexity!
26
+
27
+ ```ruby
28
+ a = Sidekiq::Batch.new
29
+ a.on(:success, SomeCallback)
30
+ a.jobs do
31
+ SomeWork.perform_async
32
+
33
+ b = Sidekiq::Batch.new
34
+ b.on(:success, MyCallback)
35
+ b.jobs do
36
+ OtherWork.perform_async
37
+ end
38
+ end
39
+ ```
40
+
41
+ Parent batch callbacks are not processed until all child batch callbacks have
42
+ run successfully. In the example above, `MyCallback` will always fire
43
+ before `SomeCallback` because `b` is considered a child of `a`.
44
+
45
+ Of course you can dynamically add child batches while a batch job is executing.
46
+
47
+ ```ruby
48
+ def perform(*args)
49
+ do_something(args)
50
+
51
+ if more_work?
52
+ # Sidekiq::Worker#batch returns the Batch this job is part of.
53
+ batch.jobs do
54
+ b = Sidekiq::Batch.new
55
+ b.on(:success, MyCallback)
56
+ b.jobs do
57
+ OtherWork.perform_async
58
+ end
59
+ end
60
+ end
61
+ end
62
+ ```
63
+
64
+ More context: [#1485]
65
+
66
+ ## Batch Data
67
+
68
+ The batch data model was overhauled. Batch data should take
69
+ significantly less space in Redis now. A simple benchmark shows 25%
70
+ savings but real world savings should be even greater.
71
+
72
+ * Batch 2.x BIDs are 14 character URL-safe Base64-encoded strings, e.g.
73
+ "vTF1-9QvLPnREQ". Batch 1.x BIDs were 16 character hex-encoded
74
+ strings, e.g. "4a3fc67d30370edf".
75
+ * In 1.x, batch data was not removed until it naturally expired in Redis.
76
+ In 2.x, all data for a batch is removed from Redis once the batch has
77
+ run any success callbacks.
78
+ * Because of the former point, batch expiry is no longer a concern.
79
+ Batch expiry is hardcoded to 30 days and is no longer user-tunable.
80
+ * Failed batch jobs no longer automatically store any associated
81
+ backtrace in Redis.
82
+
83
+ **There's no data migration required. Sidekiq Pro 2.0 transparently handles
84
+ both old and new format.**
85
+
86
+ More context: [#2130]
87
+
88
+ ## Reliability
89
+
90
+ 2.0 brings a new reliable scheduler which uses Lua inside Redis so enqueuing
91
+ scheduled jobs is atomic. Benchmarks show it 50x faster when enqueuing
92
+ lots of jobs.
93
+
94
+ **Two caveats**:
95
+ - Client-side middleware is not executed
96
+ for each job when enqueued with the reliable scheduler. No Sidekiq or
97
+ Sidekiq Pro functionality is affected by this change but some 3rd party
98
+ plugins might be.
99
+ - The Lua script used inside the reliable scheduler is not safe for use
100
+ with Redis Cluster or other multi-master Redis solutions.
101
+ It is safe to use with Redis Sentinel or a typical master/slave replication setup.
102
+
103
+ **You no longer require anything to use the Reliability features.**
104
+
105
+ * Activate reliable fetch and/or the new reliable scheduler:
106
+ ```ruby
107
+ Sidekiq.configure_server do |config|
108
+ config.reliable_fetch!
109
+ config.reliable_scheduler!
110
+ end
111
+ ```
112
+ * Activate reliable push:
113
+ ```ruby
114
+ Sidekiq::Client.reliable_push!
115
+ ```
116
+
117
+ More context: [#2130]
118
+
119
+ ## Other Changes
120
+
121
+ * You must require `sidekiq/pro/notifications` if you want to use the
122
+ existing notification schemes. I don't recommend using them as the
123
+ newer-style `Sidekiq::Batch#on` method is simpler and more flexible.
124
+ * Several classes have been renamed. Generally these classes are ones
125
+ you should not need to require/use in your own code, e.g. the Batch
126
+ middleware.
127
+ * You can add `attr_accessor :jid` to a Batch callback class and Sidekiq
128
+ Pro will set it to the jid of the callback job. [#2178]
129
+ * There's now an official API to iterate all known Batches [#2191]
130
+ ```ruby
131
+ Sidekiq::BatchSet.new.each {|status| p status.bid }
132
+ ```
133
+ * The Web UI now shows the Sidekiq Pro version in the footer. [#1991]
134
+
135
+ ## Thanks
136
+
137
+ Adam Prescott, Luke van der Hoeven and Jon Hyman all provided valuable
138
+ feedback during the release process. Thank you guys!
@@ -0,0 +1,44 @@
1
+ # Welcome to Sidekiq Pro 3.0!
2
+
3
+ Sidekiq Pro 3.0 is designed to work with Sidekiq 4.0.
4
+
5
+ ## What's New
6
+
7
+ * **Redis 2.8.0 or greater is required.** Redis 2.8 was released two years
8
+ ago and contains **many** useful features which Sidekiq couldn't
9
+ leverage until now. **Redis 3.0.3 or greater is recommended** for large
10
+ scale use.
11
+
12
+ * Sidekiq Pro no longer uses Celluloid. If your application code uses Celluloid,
13
+ you will need to pull it in yourself.
14
+
15
+ * Pausing and unpausing queues is now instantaneous, no more polling!
16
+
17
+ * Reliable fetch has been re-implemented due to the fetch changes in
18
+ Sidekiq 4.0.
19
+
20
+ * Support for platforms without persistent hostnames. Since the reliable\_fetch
21
+ algorithm requires a persistent hostname, an alternative reliability
22
+ algorithm is now available for platforms like Heroku and Docker:
23
+ ```ruby
24
+ Sidekiq.configure_server do |config|
25
+ config.timed_fetch!
26
+ end
27
+ ```
28
+ The wiki contains [much more detail about each reliability option](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server).
29
+
30
+ * The old 'sidekiq/notifications' features have been removed.
31
+
32
+ ## Upgrade
33
+
34
+ First, make sure you are using Redis 2.8 or greater. Next:
35
+
36
+ * Upgrade to the latest Sidekiq Pro 2.x.
37
+ ```ruby
38
+ gem 'sidekiq-pro', '< 3'
39
+ ```
40
+ * Fix any deprecation warnings you see.
41
+ * Upgrade to 3.x.
42
+ ```ruby
43
+ gem 'sidekiq-pro', '< 4'
44
+ ```
@@ -0,0 +1,35 @@
1
+ # Welcome to Sidekiq Pro 4.0!
2
+
3
+ Sidekiq Pro 4.0 is designed to work with Sidekiq 5.0.
4
+
5
+ ## What's New
6
+
7
+ * Batches now "die" if any of their jobs die. You can enumerate the set
8
+ of dead batches and their associated dead jobs. The success callback
9
+ for a dead batch will never fire unless these jobs are fixed.
10
+ ```ruby
11
+ Sidekiq::Batch::DeadSet.new.each do |status|
12
+ status.dead? # => true
13
+ status.dead_jobs # => [...]
14
+ end
15
+ ```
16
+ This API allows you to enumerate the batches which need help.
17
+ If you fix the issue and the dead jobs succeed, the batch will succeed.
18
+ * The older `reliable_fetch` and `timed_fetch` algorithms have been
19
+ removed. Only super\_fetch is available in 4.0.
20
+ * The statsd middleware has been tweaked to remove support for legacy,
21
+ pre-3.6.0 configuration and add relevant tags.
22
+ * Requires Sidekiq 5.0.5+.
23
+
24
+ ## Upgrade
25
+
26
+ * Upgrade to the latest Sidekiq Pro 3.x.
27
+ ```ruby
28
+ gem 'sidekiq-pro', '< 4'
29
+ ```
30
+ * Fix any deprecation warnings you see.
31
+ * Upgrade to 4.x.
32
+ ```ruby
33
+ gem 'sidekiq-pro', '< 5'
34
+ ```
35
+
@@ -0,0 +1,25 @@
1
+ # Welcome to Sidekiq Pro 5.0!
2
+
3
+ Sidekiq Pro 5.0 is mainly a cleanup release for Sidekiq 6.0. The
4
+ migration should be as close to trivial as a major version bump can be.
5
+ Note that Sidekiq 6.0 does have major breaking changes.
6
+
7
+ ## What's New
8
+
9
+ * New localizations for the Sidekiq Pro Web UI: ES, ZH, PT, JA, RU
10
+ * Removed deprecated APIs and warnings.
11
+ * Various changes for Sidekiq 6.0
12
+ * Requires Ruby 2.5+ and Redis 4.0+
13
+ * Requires Sidekiq 6.0+.
14
+
15
+ ## Upgrade
16
+
17
+ * Upgrade to the latest Sidekiq Pro 4.x.
18
+ ```ruby
19
+ gem 'sidekiq-pro', '< 5'
20
+ ```
21
+ * Fix any deprecation warnings you see.
22
+ * Upgrade to 5.x.
23
+ ```ruby
24
+ gem 'sidekiq-pro', '< 6'
25
+ ```
@@ -0,0 +1,790 @@
1
+ # Sidekiq Pro Changelog
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)
4
+
5
+ Please see [sidekiq.org](https://sidekiq.org/) for more details and how to buy.
6
+
7
+ 5.1.0
8
+ ---------
9
+
10
+ - Remove old Statsd metrics with `WorkerName` in the name [#4377]
11
+ ```
12
+ job.WorkerName.count -> job.count with tag worker:WorkerName
13
+ job.WorkerName.perform -> job.perform with tag worker:WorkerName
14
+ job.WorkerName.failure -> job.failure with tag worker:WorkerName
15
+ ```
16
+ - Remove `concurrent-ruby` gem dependency [#4586]
17
+ - Update `constantize` for batch callbacks. [#4469]
18
+ - Add queue tag to `jobs.recovered.fetch` metric [#4594]
19
+ - Refactor Pro's fetch infrastructure [#4602]
20
+
21
+ 5.0.1
22
+ ---------
23
+
24
+ - Rejigger batch failures UI to add direct links to retries and scheduled jobs [#4209]
25
+ - Delete batch data with `UNLINK` [#4155]
26
+ - Fix bug where a scheduled job can lose its scheduled time when using reliable push [#4267]
27
+ - Sidekiq::JobSet#scan and #find_job APIs have been promoted to Sidekiq OSS. [#4259]
28
+
29
+ 5.0.0
30
+ ---------
31
+
32
+ - There is no significant migration from Sidekiq Pro 4.0 to 5.0
33
+ but make sure you read the [update notes for Sidekiq
34
+ 6.0](https://github.com/mperham/sidekiq/blob/master/6.0-Upgrade.md).
35
+ - Removed various deprecated APIs and associated warnings.
36
+ - **BREAKING CHANGE** Remove the `Sidekiq::Batch::Status#dead_jobs` API in favor of
37
+ `Sidekiq::Batch::Status#dead_jids`. [#4217]
38
+ - Update Sidekiq Pro codebase to use StandardRB formatting
39
+ - Fix lingering "b-XXX-died" elements in Redis which could cause
40
+ excessive memory usage. [#4217]
41
+ - Add ES translations, see issues [#3949](https://github.com/mperham/sidekiq/issues/3949) and [#3951](https://github.com/mperham/sidekiq/issues/3951) to add your own language.
42
+
43
+ 4.0.5
44
+ ---------
45
+
46
+ - Increase super\_fetch retriever thread count from 1 to 2 to make it
47
+ less sensitive to Redis latency.
48
+ - Better handling of invalid job JSON by reliable scheduler [#4053]
49
+ - Added ZH, PT, JA and RU translations.
50
+
51
+ 4.0.4
52
+ ---------
53
+
54
+ - Update Sidekiq::Client patches to work with new Module#prepend
55
+ mechanism in Sidekiq 5.2.0. [#3930]
56
+
57
+ 4.0.3
58
+ ---------
59
+
60
+ - Add at\_exit handler to push any saved jobs in `reliable_push` when exiting. [#3823]
61
+ - Implement batch death callback. This is fired the first time a job within a batch dies. [#3841]
62
+ ```ruby
63
+ batch = Sidekiq::Batch.new
64
+ batch.on(:death, ...)
65
+ ```
66
+
67
+ 4.0.2
68
+ ---------
69
+
70
+ - Remove super\_fetch edge case leading to an unnecessary `sleep(1)`
71
+ call and resulting latency [#3790]
72
+ - Fix possible bad statsd metric call on super\_fetch startup
73
+ - Remove superfluous `freeze` calls on Strings [#3759]
74
+
75
+ 4.0.1
76
+ ---------
77
+
78
+ - Fix incompatibility with the statsd-ruby gem [#3740]
79
+ - Add tags to Statsd metrics when using Datadog [#3744]
80
+
81
+ 4.0.0
82
+ ---------
83
+
84
+ - See the [Sidekiq Pro 4.0](Pro-4.0-Upgrade.md) release notes.
85
+
86
+
87
+ 3.7.1
88
+ ---------
89
+
90
+ - Deprecate timed\_fetch. Switch to super\_fetch:
91
+ ```ruby
92
+ config.super_fetch!
93
+ ```
94
+
95
+
96
+ 3.7.0
97
+ ---------
98
+
99
+ - Refactor batch job success/failure to gracefully handle several edge
100
+ cases with regard to Sidekiq::Shutdown. This should greatly reduce
101
+ the chances of seeing the long-standing "negative pending count" problem. [#3710]
102
+
103
+
104
+ 3.6.1
105
+ ---------
106
+
107
+ - Add support for Datadog::Statsd, it is the recommended Statsd client. [#3699]
108
+ ```ruby
109
+ Sidekiq::Pro.dogstatsd = ->{ Datadog::Statsd.new("metrics.example.com", 8125) }
110
+ ```
111
+ - Size the statsd connection pool based on Sidekiq's concurrency [#3700]
112
+
113
+
114
+ 3.6.0
115
+ ---------
116
+
117
+ This release overhauls the Statsd metrics support and adds more
118
+ metrics for tracking Pro feature usage. In your initializer:
119
+ ```ruby
120
+ Sidekiq::Pro.statsd = ->{ ::Statsd.new("127.0.0.1", 8125) }
121
+ ```
122
+ Sidekiq Pro will emit more metrics to Statsd:
123
+ ```
124
+ jobs.expired - when a job is expired
125
+ jobs.recovered.push - when a job is recovered by reliable_push after network outage
126
+ jobs.recovered.fetch - when a job is recovered by super_fetch after process crash
127
+ batch.created - when a batch is created
128
+ batch.complete - when a batch is completed
129
+ batch.success - when a batch is successful
130
+ ```
131
+ Sidekiq Pro's existing Statsd middleware has been rewritten to leverage the new API.
132
+ Everything should be backwards compatible with one deprecation notice.
133
+
134
+
135
+ 3.5.4
136
+ ---------
137
+
138
+ - Fix case in SuperFetch where Redis downtime can lead to processor thread death [#3684]
139
+ - Fix case where TimedFetch might not recover some pending jobs
140
+ - Fix edge case in Batch::Status#poll leading to premature completion [#3640]
141
+ - Adjust scan API to check 100 elements at a time, to minimize network round trips
142
+ when scanning large sets.
143
+
144
+ 3.5.3
145
+ ---------
146
+
147
+ - Restore error check for super\_fetch's job ack [#3601]
148
+ - Trim error messages saved in Batch's failure hash, preventing huge
149
+ messages from bloating Redis. [#3570]
150
+
151
+ 3.5.2
152
+ ---------
153
+
154
+ - Fix `Status#completed?` when run against a Batch that had succeeded
155
+ and was deleted. [#3519]
156
+
157
+ 3.5.1
158
+ ---------
159
+
160
+ - Work with Sidekiq 5.0.2+
161
+ - Improve performance of super\_fetch with weighted queues [#3489]
162
+
163
+ 3.5.0
164
+ ---------
165
+
166
+ - Add queue pause/unpause endpoints for scripting via curl [#3445]
167
+ - Change how super\_fetch names private queues to avoid hostname/queue clashes. [#3443]
168
+ - Re-implement `Sidekiq::Queue#delete_job` to avoid O(n) runtime [#3408]
169
+ - Batch page displays Pending JIDs if less than 10 [#3130]
170
+ - Batch page has a Search button to find associated Retries [#3130]
171
+ - Make Batch UI progress bar more friendly to the colorblind [#3387]
172
+
173
+ 3.4.5
174
+ ---------
175
+
176
+ - Fix potential job loss with reliable scheduler when lots of jobs are scheduled
177
+ at precisely the same time. Thanks to raivil for his hard work in
178
+ reproducing the bug. [#3371]
179
+
180
+ 3.4.4
181
+ ---------
182
+
183
+ - Optimize super\_fetch shutdown to restart jobs quicker [#3249]
184
+
185
+ 3.4.3
186
+ ---------
187
+
188
+ - Limit reliable scheduler to enqueue up to 100 jobs per call, minimizing Redis latency [#3332]
189
+ - Fix bug in super\_fetch logic for queues with `_` in the name [#3339]
190
+
191
+ 3.4.2
192
+ ---------
193
+
194
+ - Add `Batch::Status#invalidated?` API which returns true if any/all
195
+ JIDs were invalidated within the batch. [#3326]
196
+
197
+ 3.4.1
198
+ ---------
199
+
200
+ - Allow super\_fetch's orphan job check to happen as often as every hour [#3273]
201
+ - Officially deprecate reliable\_fetch algorithm, I now recommend you use `super_fetch` instead:
202
+ ```ruby
203
+ Sidekiq.configure_server do |config|
204
+ config.super_fetch!
205
+ end
206
+ ```
207
+ Also note that Sidekiq's `-i/--index` option is no longer used/relevant with super\_fetch.
208
+ - Don't display "Delete/Retry All" buttons when filtering in Web UI [#3243]
209
+ - Reimplement Sidekiq::JobSet#find\_job with ZSCAN [#3197]
210
+
211
+ 3.4.0
212
+ ---------
213
+
214
+ - Introducing the newest reliable fetching algorithm: `super_fetch`! This
215
+ algorithm will replace reliable\_fetch in Pro 4.0. super\_fetch is
216
+ bullet-proof across all environments, no longer requiring stable
217
+ hostnames or an index to be set per-process. [#3077]
218
+ ```ruby
219
+ Sidekiq.configure_server do |config|
220
+ config.super_fetch!
221
+ end
222
+ ```
223
+ Thank you to @jonhyman for code review and the Sidekiq Pro customers that
224
+ beta tested super\_fetch.
225
+
226
+ 3.3.3
227
+ ---------
228
+
229
+ - Update Web UI extension to work with Sidekiq 4.2.0's new Web UI. [#3075]
230
+
231
+ 3.3.2
232
+ ---------
233
+
234
+ - Minimize batch memory usage after success [#3083]
235
+ - Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
236
+
237
+ 3.3.1
238
+ ---------
239
+
240
+ - If environment is unset, treat it as development so reliable\_fetch works as before 3.2.2.
241
+
242
+ 3.3.0
243
+ ---------
244
+
245
+ - Don't delete batches immediately upon success but set a 24 hr expiry, this allows
246
+ Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
247
+ - New `Sidekiq::PendingSet#destroy(jid)` API to remove poison pill jobs [#3015]
248
+
249
+ 3.2.2
250
+ ---------
251
+
252
+ - A default value for -i is only set in development now, staging or
253
+ other environments must set an index if you wish to use reliable\_fetch. [#2971]
254
+ - Fix nil dereference when checking for jobs over timeout in timed\_fetch
255
+
256
+
257
+ 3.2.1
258
+ ---------
259
+
260
+ - timed\_fetch now works with namespaces. [ryansch]
261
+
262
+
263
+ 3.2.0
264
+ ---------
265
+
266
+ - Fixed detection of missing batches, `NoSuchBatch` should be raised
267
+ properly now if `Sidekiq::Batch.new(bid)` is called on a batch no
268
+ longer in Redis.
269
+ - Remove support for Pro 1.x format batches. This version will no
270
+ longer seamlessly process batches created with Sidekiq Pro 1.x.
271
+ As always, upgrade one major version at a time to ensure a smooth
272
+ transition.
273
+ - Fix edge case where a parent batch could expire before a child batch
274
+ was finished processing, leading to missing batches [#2889]
275
+
276
+ 2.1.5
277
+ ---------
278
+
279
+ - Fix edge case where a parent batch could expire before a child batch
280
+ was finished processing, leading to missing batches [#2889]
281
+
282
+ 3.1.0
283
+ ---------
284
+
285
+ - New container-friendly fetch algorithm: `timed_fetch`. See the
286
+ [wiki documentation](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server)
287
+ for trade offs between the two reliability options. You should
288
+ use this if you are on Heroku, Docker, Amazon ECS or EBS or
289
+ another container-based system.
290
+
291
+
292
+ 3.0.6
293
+ ---------
294
+
295
+ - Fix race condition on reliable fetch shutdown
296
+
297
+ 3.0.5
298
+ ---------
299
+
300
+ - Statsd metrics now account for ActiveJob class names
301
+ - Allow reliable fetch internals to be overridden [jonhyman]
302
+
303
+ 3.0.4
304
+ ---------
305
+
306
+ - Queue pausing no longer requires reliable fetch. [#2786]
307
+
308
+ 3.0.3, 2.1.4
309
+ ------------
310
+
311
+ - Convert Lua-based `Sidekiq::Queue#delete_by_class` to Ruby-based, to
312
+ avoid O(N^2) performance and possible Redis failure. [#2806]
313
+
314
+ 3.0.2
315
+ -----------
316
+
317
+ - Make job registration with batch part of the atomic push so batch
318
+ metadata can't get out of sync with the job data. [#2714]
319
+
320
+ 3.0.1
321
+ -----------
322
+
323
+ - Remove a number of Redis version checks since we can assume 2.8+ now.
324
+ - Fix expiring jobs client middleware not loaded on server
325
+
326
+ 3.0.0
327
+ -----------
328
+
329
+ - See the [Pro 3.0 release notes](Pro-3.0-Upgrade.md).
330
+
331
+ 2.1.3
332
+ -----------
333
+
334
+ - Don't enable strict priority if using weighted queueing like `-q a,1 -q b,1`
335
+ - Safer JSON mangling in Lua [#2639]
336
+
337
+ 2.1.2
338
+ -----------
339
+
340
+ - Lock Sidekiq Pro 2.x to Sidekiq 3.x.
341
+
342
+ 2.1.1
343
+ -----------
344
+
345
+ - Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
346
+
347
+
348
+ 2.1.0
349
+ -----------
350
+
351
+ - Explicit support for sharding batches. You list your Redis shards and
352
+ Sidekiq Pro will randomly spread batches across the shards. The BID
353
+ will indicate which shard contains the batch data. Jobs within a
354
+ batch may be spread across all shards too. [#2548, jonhyman]
355
+ - Officially deprecate Sidekiq::Notifications code. Notifications have
356
+ been undocumented for months now. [#2575]
357
+
358
+
359
+ 2.0.8
360
+ -----------
361
+
362
+ - Fix reliable scheduler mangling large numeric arguments. Lua's CJSON
363
+ library cannot accurately encode numbers larger than 14 digits! [#2478]
364
+
365
+ 2.0.7
366
+ -----------
367
+
368
+ - Optimize delete of enormous batches (100,000s of jobs) [#2458]
369
+
370
+ 2.0.6, 1.9.3
371
+ --------------
372
+
373
+ - CSRF protection in Sidekiq 3.4.2 broke job filtering in the Web UI [#2442]
374
+ - Sidekiq Pro 1.x is now limited to Sidekiq < 3.5.0.
375
+
376
+ 2.0.5
377
+ -----------
378
+
379
+ - Atomic scheduler now sets `enqueued_at` [#2414]
380
+ - Batches now account for jobs which are stopped by client middleware [#2406]
381
+ - Ignore redundant calls to `Sidekiq::Client.reliable_push!` [#2408]
382
+
383
+ 2.0.4
384
+ -----------
385
+
386
+ - Reliable push now supports sharding [#2409]
387
+ - Reliable push now only catches Redis exceptions [#2307]
388
+
389
+ 2.0.3
390
+ -----------
391
+
392
+ - Display Batch callback data on the Batch details page. [#2347]
393
+ - Fix incompatibility with Pro Web and Rack middleware. [#2344] Thank
394
+ you to Jason Clark for the tip on how to fix it.
395
+
396
+ 2.0.2
397
+ -----------
398
+
399
+ - Multiple Web UIs can now run in the same process. [#2267] If you have
400
+ multiple Redis shards, you can mount UIs for all in the same process:
401
+ ```ruby
402
+ POOL1 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6379/0") }
403
+ POOL2 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6378/0") }
404
+
405
+ mount Sidekiq::Pro::Web => '/sidekiq' # default
406
+ mount Sidekiq::Pro::Web.with(redis_pool: POOL1), at: '/sidekiq1', as: 'sidekiq1' # shard1
407
+ mount Sidekiq::Pro::Web.with(redis_pool: POOL2), at: '/sidekiq2', as: 'sidekiq2' # shard2
408
+ ```
409
+ - **SECURITY** Fix batch XSS in error data. Thanks to moneybird.com for
410
+ reporting the issue.
411
+
412
+ 2.0.1
413
+ -----------
414
+
415
+ - Add `batch.callback_queue` so batch callbacks can use a higher
416
+ priority queue than jobs. [#2200]
417
+ - Gracefully recover if someone runs `SCRIPT FLUSH` on Redis. [#2240]
418
+ - Ignore errors when attempting `bulk_requeue`, allowing clean shutdown
419
+
420
+ 2.0.0
421
+ -----------
422
+
423
+ - See [the Upgrade Notes](Pro-2.0-Upgrade.md) for detailed notes.
424
+
425
+ 1.9.2
426
+ -----------
427
+
428
+ - As of 1/1/2015, Sidekiq Pro is hosted on a new dedicated server.
429
+ Happy new year and let's hope for 100% uptime!
430
+ - Fix bug in reliable\_fetch where jobs could be duplicated if a Sidekiq
431
+ process crashed and you were using weighted queues. [#2120]
432
+
433
+ 1.9.1
434
+ -----------
435
+
436
+ - **SECURITY** Fix XSS in batch description, thanks to intercom.io for reporting the
437
+ issue. If you don't use batch descriptions, you don't need the fix.
438
+
439
+ 1.9.0
440
+ -----------
441
+
442
+ - Add new expiring jobs feature [#1982]
443
+ - Show batch expiration on Batch details page [#1981]
444
+ - Add '$' batch success token to the pubsub support. [#1953]
445
+
446
+
447
+ 1.8.0
448
+ -----------
449
+
450
+ - Fix race condition where Batches can complete
451
+ before they have been fully defined or only half-defined. Requires
452
+ Sidekiq 3.2.3. [#1919]
453
+
454
+
455
+ 1.7.6
456
+ -----------
457
+
458
+ - Quick release to verify #1919
459
+
460
+
461
+ 1.7.5
462
+ -----------
463
+
464
+ - Fix job filtering within the Dead tab.
465
+ - Add APIs and wiki documentation for invalidating jobs within a batch.
466
+
467
+
468
+ 1.7.4
469
+ -----------
470
+
471
+ - Awesome ANSI art startup banner!
472
+
473
+
474
+ 1.7.3
475
+ -----------
476
+
477
+ - Batch callbacks should use the same queue as the associated jobs.
478
+
479
+ 1.7.2
480
+ -----------
481
+
482
+ - **DEPRECATION** Use `Batch#on(:complete)` instead of `Batch#notify`.
483
+ The specific Campfire, HipChat, email and other notification schemes
484
+ will be removed in 2.0.0.
485
+ - Remove batch from UI when successful. [#1745]
486
+ - Convert batch callbacks to be asynchronous jobs for error handling [#1744]
487
+
488
+ 1.7.1
489
+ -----------
490
+
491
+ - Fix for paused queues being processed for a few seconds when starting
492
+ a new Sidekiq process.
493
+ - Add a 5 sec delay when starting reliable fetch on Heroku to minimize
494
+ any duplicate job processing with another process shutting down.
495
+
496
+ 1.7.0
497
+ -----------
498
+
499
+ - Add ability to pause reliable queues via API.
500
+ ```ruby
501
+ q = Sidekiq::Queue.new("critical")
502
+ q.pause!
503
+ q.paused? # => true
504
+ q.unpause!
505
+ ```
506
+
507
+ Sidekiq polls Redis every 10 seconds for paused queues so pausing will take
508
+ a few seconds to take effect.
509
+
510
+ 1.6.0
511
+ -----------
512
+
513
+ - Compatible with Sidekiq 3.
514
+
515
+ 1.5.1
516
+ -----------
517
+
518
+ - Due to a breaking API change in Sidekiq 3.0, this version is limited
519
+ to Sidekiq 2.x.
520
+
521
+ 1.5.0
522
+ -----------
523
+
524
+ - Fix issue on Heroku where reliable fetch could orphan jobs [#1573]
525
+
526
+
527
+ 1.4.3
528
+ -----------
529
+
530
+ - Reverse sorting of Batches in Web UI [#1098]
531
+ - Refactoring for Sidekiq 3.0, Pro now requires Sidekiq 2.17.5
532
+
533
+ 1.4.2
534
+ -----------
535
+
536
+ - Tolerate expired Batches in the web UI.
537
+ - Fix 100% CPU usage when using weighted queues and reliable fetch.
538
+
539
+ 1.4.1
540
+ -----------
541
+
542
+ - Add batch progress bar to batch detail page. [#1398]
543
+ - Fix race condition in initializing Lua scripts
544
+
545
+
546
+ 1.4.0
547
+ -----------
548
+
549
+ - Default batch expiration has been extended to 3 days, from 1 day previously.
550
+ - Batches now sort in the Web UI according to expiry time, not creation time.
551
+ - Add user-configurable batch expiry. If your batches might take longer
552
+ than 72 hours to process, you can extend the expiration date.
553
+
554
+ ```ruby
555
+ b = Sidekiq::Batch.new
556
+ b.expires_in 5.days
557
+ ...
558
+ ```
559
+
560
+ 1.3.2
561
+ -----------
562
+
563
+ - Lazy load Lua scripts so a Redis connection is not required on bootup.
564
+
565
+ 1.3.1
566
+ -----------
567
+
568
+ - Fix a gemspec packaging issue which broke the Batch UI.
569
+
570
+ 1.3.0
571
+ -----------
572
+
573
+ Thanks to @jonhyman for his contributions to this Sidekiq Pro release.
574
+
575
+ This release includes new functionality based on the SCAN command newly
576
+ added to Redis 2.8. Pro still works with Redis 2.4 but some
577
+ functionality will be unavailable.
578
+
579
+ - Job Filtering in the Web UI!
580
+ You can now filter retries and scheduled jobs in the Web UI so you
581
+ only see the jobs relevant to your needs. Queues cannot be filtered;
582
+ Redis does not provide the same SCAN operation on the LIST type.
583
+ **Redis 2.8**
584
+ ![Filtering](https://f.cloud.github.com/assets/2911/1619465/f47529f2-5657-11e3-8cd1-33899eb72aad.png)
585
+ - SCAN support in the Sidekiq::SortedSet API. Here's an example that
586
+ finds all jobs which contain the substring "Warehouse::OrderShip"
587
+ and deletes all matching retries. If the set is large, this API
588
+ will be **MUCH** faster than standard iteration using each.
589
+ **Redis 2.8**
590
+ ```ruby
591
+ Sidekiq::RetrySet.new.scan("Warehouse::OrderShip") do |job|
592
+ job.delete
593
+ end
594
+ ```
595
+
596
+ - Sidekiq::Batch#jobs now returns the set of JIDs added to the batch.
597
+ - Sidekiq::Batch#jids returns the complete set of JIDs associated with the batch.
598
+ - Sidekiq::Batch#remove\_jobs(jid, jid, ...) removes JIDs from the set, allowing early termination of jobs if they become irrelevant according to application logic.
599
+ - Sidekiq::Batch#include?(jid) allows jobs to check if they are still
600
+ relevant to a Batch and exit early if not.
601
+ - Sidekiq::SortedSet#find\_job(jid) now uses server-side Lua if possible **Redis 2.6** [jonhyman]
602
+ - The statsd integration now sets global job counts:
603
+ ```ruby
604
+ jobs.count
605
+ jobs.success
606
+ jobs.failure
607
+ ```
608
+
609
+ - Change shutdown logic to push leftover jobs in the private queue back
610
+ into the public queue when shutting down with Reliable Fetch. This
611
+ allows the safe decommission of a Sidekiq Pro process when autoscaling. [jonhyman]
612
+ - Add support for weighted random fetching with Reliable Fetch [jonhyman]
613
+ - Pro now requires Sidekiq 2.17.0
614
+
615
+ 1.2.5
616
+ -----------
617
+
618
+ - Convert Batch UI to use Sidekiq 2.16's support for extension localization.
619
+ - Update reliable\_push to work with Sidekiq::Client refactoring in 2.16
620
+ - Pro now requires Sidekiq 2.16.0
621
+
622
+ 1.2.4
623
+ -----------
624
+
625
+ - Convert Batch UI to Bootstrap 3
626
+ - Pro now requires Sidekiq 2.15.0
627
+ - Add Sidekiq::Batch::Status#delete [#1205]
628
+
629
+ 1.2.3
630
+ -----------
631
+
632
+ - Pro now requires Sidekiq 2.14.0
633
+ - Fix bad exception handling in batch callbacks [#1134]
634
+ - Convert Batch UI to ERB
635
+
636
+ 1.2.2
637
+ -----------
638
+
639
+ - Problem with reliable fetch which could lead to lost jobs when Sidekiq
640
+ is shut down normally. Thanks to MikaelAmborn for the report. [#1109]
641
+
642
+ 1.2.1
643
+ -----------
644
+
645
+ - Forgot to push paging code necessary for `delete_job` performance.
646
+
647
+ 1.2.0
648
+ -----------
649
+
650
+ - **LEAK** Fix batch key which didn't expire in Redis. Keys match
651
+ /b-[a-f0-9]{16}-pending/, e.g. "b-4f55163ddba10aa0-pending" [#1057]
652
+ - **Reliable fetch now supports multiple queues**, using the algorithm spec'd
653
+ by @jackrg [#1102]
654
+ - Fix issue with reliable\_push where it didn't return the JID for a pushed
655
+ job when sending previously cached jobs to Redis.
656
+ - Add fast Sidekiq::Queue#delete\_job(jid) API which leverages Lua so job lookup is
657
+ 100% server-side. Benchmark vs Sidekiq's Job#delete API. **Redis 2.6**
658
+
659
+ ```
660
+ Sidekiq Pro API
661
+ 0.030000 0.020000 0.050000 ( 1.640659)
662
+ Sidekiq API
663
+ 17.250000 2.220000 19.470000 ( 22.193300)
664
+ ```
665
+
666
+ - Add fast Sidekiq::Queue#delete\_by\_class(klass) API to remove all
667
+ jobs of a given type. Uses server-side Lua for performance. **Redis 2.6**
668
+
669
+ 1.1.0
670
+ -----------
671
+
672
+ - New `sidekiq/pro/reliable_push` which makes Sidekiq::Client resiliant
673
+ to Redis network failures. [#793]
674
+ - Move `sidekiq/reliable_fetch` to `sidekiq/pro/reliable_fetch`
675
+
676
+
677
+ 1.0.0
678
+ -----------
679
+
680
+ - Sidekiq Pro changelog moved to mperham/sidekiq for public visibility.
681
+ - Add new Rack endpoint for easy polling of batch status via JavaScript. See `sidekiq/rack/batch_status`
682
+
683
+ 0.9.3
684
+ -----------
685
+
686
+ - Fix bad /batches path in Web UI
687
+ - Fix Sinatra conflict with sidekiq-failures
688
+
689
+ 0.9.2
690
+ -----------
691
+
692
+ - Fix issue with lifecycle notifications not firing.
693
+
694
+ 0.9.1
695
+ -----------
696
+
697
+ - Update due to Sidekiq API changes.
698
+
699
+ 0.9.0
700
+ -----------
701
+
702
+ - Rearchitect Sidekiq's Fetch code to support different fetch
703
+ strategies. Add a ReliableFetch strategy which works with Redis'
704
+ RPOPLPUSH to ensure we don't lose messages, even when the Sidekiq
705
+ process crashes unexpectedly. [mperham/sidekiq#607]
706
+
707
+ 0.8.2
708
+ -----------
709
+
710
+ - Reimplement existing notifications using batch on_complete events.
711
+
712
+ 0.8.1
713
+ -----------
714
+
715
+ - Rejigger batch callback notifications.
716
+
717
+
718
+ 0.8.0
719
+ -----------
720
+
721
+ - Add new Batch 'callback' notification support, for in-process
722
+ notification.
723
+ - Symbolize option keys passed to Pony [mperham/sidekiq#603]
724
+ - Batch no longer requires the Web UI since Web UI usage is optional.
725
+ You must require is manually in your Web process:
726
+
727
+ ```ruby
728
+ require 'sidekiq/web'
729
+ require 'sidekiq/batch/web'
730
+ mount Sidekiq::Web => '/sidekiq'
731
+ ```
732
+
733
+
734
+ 0.7.1
735
+ -----------
736
+
737
+ - Worker instances can access the associated jid and bid via simple
738
+ accessors.
739
+ - Batches can now be modified while being processed so, e.g. a batch
740
+ job can add additional jobs to its own batch.
741
+
742
+ ```ruby
743
+ def perform(...)
744
+ batch = Sidekiq::Batch.new(bid) # instantiate batch associated with this job
745
+ batch.jobs do
746
+ SomeWorker.perform_async # add another job
747
+ end
748
+ end
749
+ ```
750
+
751
+ - Save error backtraces in batch's failure info for display in Web UI.
752
+ - Clean up email notification a bit.
753
+
754
+
755
+ 0.7.0
756
+ -----------
757
+
758
+ - Add optional batch description
759
+ - Mutable batches. Batches can now be modified to add additional jobs
760
+ at runtime. Example would be a batch job which needs to create more
761
+ jobs based on the data it is processing.
762
+
763
+ ```ruby
764
+ batch = Sidekiq::Batch.new(bid)
765
+ batch.jobs do
766
+ # define more jobs here
767
+ end
768
+ ```
769
+ - Fix issues with symbols vs strings in option hashes
770
+
771
+
772
+ 0.6.1
773
+ -----------
774
+
775
+ - Webhook notification support
776
+
777
+
778
+ 0.6
779
+ -----------
780
+
781
+ - Redis pubsub
782
+ - Email polish
783
+
784
+
785
+ 0.5
786
+ -----------
787
+
788
+ - Batches
789
+ - Notifications
790
+ - Statsd middleware