sidekiq 5.0.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 (116) hide show
  1. checksums.yaml +7 -0
  2. data/.github/contributing.md +32 -0
  3. data/.github/issue_template.md +9 -0
  4. data/.gitignore +13 -0
  5. data/.travis.yml +18 -0
  6. data/3.0-Upgrade.md +70 -0
  7. data/4.0-Upgrade.md +53 -0
  8. data/5.0-Upgrade.md +56 -0
  9. data/COMM-LICENSE +95 -0
  10. data/Changes.md +1402 -0
  11. data/Ent-Changes.md +174 -0
  12. data/Gemfile +29 -0
  13. data/LICENSE +9 -0
  14. data/Pro-2.0-Upgrade.md +138 -0
  15. data/Pro-3.0-Upgrade.md +44 -0
  16. data/Pro-Changes.md +632 -0
  17. data/README.md +107 -0
  18. data/Rakefile +12 -0
  19. data/bin/sidekiq +18 -0
  20. data/bin/sidekiqctl +99 -0
  21. data/bin/sidekiqload +149 -0
  22. data/code_of_conduct.md +50 -0
  23. data/lib/generators/sidekiq/templates/worker.rb.erb +9 -0
  24. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +6 -0
  25. data/lib/generators/sidekiq/templates/worker_test.rb.erb +8 -0
  26. data/lib/generators/sidekiq/worker_generator.rb +49 -0
  27. data/lib/sidekiq.rb +228 -0
  28. data/lib/sidekiq/api.rb +871 -0
  29. data/lib/sidekiq/cli.rb +413 -0
  30. data/lib/sidekiq/client.rb +238 -0
  31. data/lib/sidekiq/core_ext.rb +119 -0
  32. data/lib/sidekiq/delay.rb +21 -0
  33. data/lib/sidekiq/exception_handler.rb +31 -0
  34. data/lib/sidekiq/extensions/action_mailer.rb +57 -0
  35. data/lib/sidekiq/extensions/active_record.rb +40 -0
  36. data/lib/sidekiq/extensions/class_methods.rb +40 -0
  37. data/lib/sidekiq/extensions/generic_proxy.rb +31 -0
  38. data/lib/sidekiq/fetch.rb +81 -0
  39. data/lib/sidekiq/job_logger.rb +27 -0
  40. data/lib/sidekiq/job_retry.rb +235 -0
  41. data/lib/sidekiq/launcher.rb +167 -0
  42. data/lib/sidekiq/logging.rb +106 -0
  43. data/lib/sidekiq/manager.rb +138 -0
  44. data/lib/sidekiq/middleware/chain.rb +150 -0
  45. data/lib/sidekiq/middleware/i18n.rb +42 -0
  46. data/lib/sidekiq/middleware/server/active_record.rb +22 -0
  47. data/lib/sidekiq/paginator.rb +43 -0
  48. data/lib/sidekiq/processor.rb +238 -0
  49. data/lib/sidekiq/rails.rb +60 -0
  50. data/lib/sidekiq/redis_connection.rb +106 -0
  51. data/lib/sidekiq/scheduled.rb +147 -0
  52. data/lib/sidekiq/testing.rb +324 -0
  53. data/lib/sidekiq/testing/inline.rb +29 -0
  54. data/lib/sidekiq/util.rb +63 -0
  55. data/lib/sidekiq/version.rb +4 -0
  56. data/lib/sidekiq/web.rb +213 -0
  57. data/lib/sidekiq/web/action.rb +89 -0
  58. data/lib/sidekiq/web/application.rb +331 -0
  59. data/lib/sidekiq/web/helpers.rb +286 -0
  60. data/lib/sidekiq/web/router.rb +100 -0
  61. data/lib/sidekiq/worker.rb +144 -0
  62. data/sidekiq.gemspec +32 -0
  63. data/web/assets/images/favicon.ico +0 -0
  64. data/web/assets/images/logo.png +0 -0
  65. data/web/assets/images/status.png +0 -0
  66. data/web/assets/javascripts/application.js +92 -0
  67. data/web/assets/javascripts/dashboard.js +298 -0
  68. data/web/assets/stylesheets/application-rtl.css +246 -0
  69. data/web/assets/stylesheets/application.css +1111 -0
  70. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  71. data/web/assets/stylesheets/bootstrap.css +5 -0
  72. data/web/locales/ar.yml +80 -0
  73. data/web/locales/cs.yml +78 -0
  74. data/web/locales/da.yml +68 -0
  75. data/web/locales/de.yml +69 -0
  76. data/web/locales/el.yml +68 -0
  77. data/web/locales/en.yml +79 -0
  78. data/web/locales/es.yml +69 -0
  79. data/web/locales/fa.yml +80 -0
  80. data/web/locales/fr.yml +78 -0
  81. data/web/locales/he.yml +79 -0
  82. data/web/locales/hi.yml +75 -0
  83. data/web/locales/it.yml +69 -0
  84. data/web/locales/ja.yml +78 -0
  85. data/web/locales/ko.yml +68 -0
  86. data/web/locales/nb.yml +77 -0
  87. data/web/locales/nl.yml +68 -0
  88. data/web/locales/pl.yml +59 -0
  89. data/web/locales/pt-br.yml +68 -0
  90. data/web/locales/pt.yml +67 -0
  91. data/web/locales/ru.yml +78 -0
  92. data/web/locales/sv.yml +68 -0
  93. data/web/locales/ta.yml +75 -0
  94. data/web/locales/uk.yml +76 -0
  95. data/web/locales/ur.yml +80 -0
  96. data/web/locales/zh-cn.yml +68 -0
  97. data/web/locales/zh-tw.yml +68 -0
  98. data/web/views/_footer.erb +17 -0
  99. data/web/views/_job_info.erb +88 -0
  100. data/web/views/_nav.erb +66 -0
  101. data/web/views/_paging.erb +23 -0
  102. data/web/views/_poll_link.erb +7 -0
  103. data/web/views/_status.erb +4 -0
  104. data/web/views/_summary.erb +40 -0
  105. data/web/views/busy.erb +94 -0
  106. data/web/views/dashboard.erb +75 -0
  107. data/web/views/dead.erb +34 -0
  108. data/web/views/layout.erb +40 -0
  109. data/web/views/morgue.erb +75 -0
  110. data/web/views/queue.erb +45 -0
  111. data/web/views/queues.erb +28 -0
  112. data/web/views/retries.erb +76 -0
  113. data/web/views/retry.erb +34 -0
  114. data/web/views/scheduled.erb +54 -0
  115. data/web/views/scheduled_job_info.erb +8 -0
  116. metadata +366 -0
@@ -0,0 +1,174 @@
1
+ # Sidekiq Enterprise 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 [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
6
+
7
+ 1.5.2
8
+ -------------
9
+
10
+ - Fix encrypted arguments double-encrypted by retry or rate limiting [#3368]
11
+ - Fix leak in concurrent rate limiter, run this in Rails console to clean up existing data [#3323]
12
+ ```ruby
13
+ expiry = 1.month.to_i; Sidekiq::Limiter.redis { |c| c.scan_each(match: "lmtr-cfree-*") { |key| c.expire(key, expiry) } }
14
+ ```
15
+
16
+ 1.5.1
17
+ -------------
18
+
19
+ - Fix issue with census startup when not using Bundler configuration for
20
+ source credentials.
21
+
22
+ 1.5.0
23
+ -------------
24
+
25
+ - Add new web authorization API [#3251]
26
+ - Update all sidekiqswarm env vars to use SIDEKIQ\_ prefix [#3218]
27
+ - Add census reporting, the leader will ping contribsys nightly with aggregate usage metrics
28
+
29
+ 1.4.0
30
+ -------------
31
+
32
+ - No functional changes, require latest Sidekiq and Sidekiq Pro versions
33
+
34
+ 1.3.2
35
+ -------------
36
+
37
+ - Upgrade encryption to use OpenSSL's more secure GCM mode. [#3060]
38
+
39
+ 1.3.1
40
+ -------------
41
+
42
+ - Fix multi-process memory monitoring on CentOS 6.x [#3063]
43
+ - Polish the new encryption feature a bit.
44
+
45
+ 1.3.0
46
+ -------------
47
+
48
+ - **BETA** [New encryption feature](https://github.com/mperham/sidekiq/wiki/Ent-Encryption)
49
+ which automatically encrypts the last argument of a Worker, aka the secret bag.
50
+
51
+ 1.2.4
52
+ -------------
53
+
54
+ - Fix issue causing some minutely jobs to execute every other minute.
55
+ - Log a warning if slow periodic processing causes us to miss a clock tick.
56
+
57
+ 1.2.3
58
+ -------------
59
+
60
+ - Periodic jobs could stop executing until process restart if Redis goes down [#3047]
61
+
62
+ 1.2.2
63
+ -------------
64
+
65
+ - Add API to check if a unique lock is present. See [#2932] for details.
66
+ - Tune concurrent limiters to minimize thread thrashing under heavy contention. [#2944]
67
+ - Add option for tuning which Bundler groups get preloaded with `sidekiqswarm` [#3025]
68
+ ```
69
+ SIDEKIQ_PRELOAD=default,production bin/sidekiqswarm ...
70
+ # Use an empty value for maximum application compatibility
71
+ SIDEKIQ_PRELOAD= bin/sidekiqswarm ...
72
+ ```
73
+
74
+ 1.2.1
75
+ -------------
76
+
77
+ - Multi-Process mode can now monitor the RSS memory of children and
78
+ restart any that grow too large. To limit children to 1GB each:
79
+ ```
80
+ MAXMEM_KB=1048576 COUNT=2 bundle exec sidekiqswarm ...
81
+ ```
82
+
83
+ 1.2.0
84
+ -------------
85
+
86
+ - **NEW FEATURE** Multi-process mode! Sidekiq Enterprise can now fork multiple worker
87
+ processes, enabling significant memory savings. See the [wiki
88
+ documentation](https://github.com/mperham/sidekiq/wiki/Ent-Multi-Process) for details.
89
+
90
+
91
+ 0.7.10
92
+ -------------
93
+
94
+ - More precise gemspec dependency versioning
95
+
96
+ 1.1.0
97
+ -------------
98
+
99
+ - **NEW FEATURE** Historical queue metrics, [documented in the wiki](https://github.com/mperham/sidekiq/wiki/Ent-Historical-Metrics) [#2719]
100
+
101
+ 0.7.9, 1.0.2
102
+ -------------
103
+
104
+ - Window limiters can now accept arbitrary window sizes [#2686]
105
+ - Fix race condition in window limiters leading to non-stop OverLimit [#2704]
106
+ - Fix invalid overage counts when nesting concurrent limiters
107
+
108
+ 1.0.1
109
+ ----------
110
+
111
+ - Fix crash in periodic subsystem when a follower shuts down, thanks
112
+ to @justinko for reporting.
113
+
114
+ 1.0.0
115
+ ----------
116
+
117
+ - Enterprise 1.x targets Sidekiq 4.x.
118
+ - Rewrite several features to remove Celluloid dependency. No
119
+ functional changes.
120
+
121
+ 0.7.8
122
+ ----------
123
+
124
+ - Fix `unique_for: false` [#2658]
125
+
126
+
127
+ 0.7.7
128
+ ----------
129
+
130
+ - Enterprise 0.x targets Sidekiq 3.x.
131
+ - Fix racy shutdown event which could lead to disappearing periodic
132
+ jobs, requires Sidekiq >= 3.5.3.
133
+ - Add new :leader event which is fired when a process gains leadership.
134
+
135
+ 0.7.6
136
+ ----------
137
+
138
+ - Redesign how overrated jobs are rescheduled to avoid creating new
139
+ jobs. [#2619]
140
+
141
+ 0.7.5
142
+ ----------
143
+
144
+ - Fix dynamic creation of concurrent limiters [#2617]
145
+
146
+ 0.7.4
147
+ ----------
148
+ - Add additional check to prevent duplicate periodic job creation
149
+ - Allow user-specified TTLs for rate limiters [#2607]
150
+ - Paginate rate limiter index page [#2606]
151
+
152
+ 0.7.3
153
+ ----------
154
+
155
+ - Rework `Sidekiq::Limiter` redis handling to match global redis handling.
156
+ - Allow user to customize rate limit backoff logic and handle custom
157
+ rate limit errors.
158
+ - Fix scalability issue with Limiter index page.
159
+
160
+ 0.7.2
161
+ ----------
162
+
163
+ - Fix typo which prevented limiters with '0' in their names.
164
+
165
+ 0.7.1
166
+ ----------
167
+
168
+ - Fix issue where unique scheduled jobs can't be enqueued upon schedule
169
+ due to the existing unique lock. [#2499]
170
+
171
+ 0.7.0
172
+ ----------
173
+
174
+ Initial release.
data/Gemfile ADDED
@@ -0,0 +1,29 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
4
+ gem 'rails', '>= 5.0.1'
5
+ gem "hiredis"
6
+ gem 'simplecov'
7
+ gem 'minitest'
8
+ #gem 'minitest-utils'
9
+ gem 'toxiproxy'
10
+
11
+ platforms :rbx do
12
+ gem 'rubysl', '~> 2.0' # if using anything in the ruby standard library
13
+ gem 'psych' # if using yaml
14
+ gem 'rubinius-developer_tools' # if using any of coverage, debugger, profiler
15
+ end
16
+
17
+ platforms :ruby do
18
+ gem 'sqlite3'
19
+ end
20
+
21
+ platforms :mri do
22
+ gem 'pry-byebug'
23
+ gem 'ruby-prof'
24
+ end
25
+
26
+ #platforms :jruby do
27
+ #gem 'jruby-openssl'
28
+ #gem 'activerecord-jdbcsqlite3-adapter'
29
+ #end
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 http://sidekiq.org/pro/ 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,632 @@
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 [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
6
+
7
+ HEAD
8
+ ---------
9
+
10
+ - Re-implement `Sidekiq::Queue#delete_job` to avoid O(n) runtime [#3408]
11
+ - Batch page displays Pending JIDs if less than 10 [#3130]
12
+ - Batch page has a Search button to find associated Retries [#3130]
13
+ - Make Batch UI progress bar more friendly to the colorblind [#3387]
14
+
15
+ 3.4.5
16
+ ---------
17
+
18
+ - Fix potential job loss with reliable scheduler when lots of jobs are scheduled
19
+ at precisely the same time. Thanks to raivil for his hard work in
20
+ reproducing the bug. [#3371]
21
+
22
+ 3.4.4
23
+ ---------
24
+
25
+ - Optimize super\_fetch shutdown to restart jobs quicker [#3249]
26
+
27
+ 3.4.3
28
+ ---------
29
+
30
+ - Limit reliable scheduler to enqueue up to 100 jobs per call, minimizing Redis latency [#3332]
31
+ - Fix bug in super\_fetch logic for queues with `_` in the name [#3339]
32
+
33
+ 3.4.2
34
+ ---------
35
+
36
+ - Add `Batch::Status#invalidated?` API which returns true if any/all
37
+ JIDs were invalidated within the batch. [#3326]
38
+
39
+ 3.4.1
40
+ ---------
41
+
42
+ - Allow super\_fetch's orphan job check to happen as often as every hour [#3273]
43
+ - Officially deprecate reliable\_fetch algorithm, I now recommend you use `super_fetch` instead:
44
+ ```ruby
45
+ Sidekiq.configure_server do |config|
46
+ config.super_fetch!
47
+ end
48
+ ```
49
+ Also note that Sidekiq's `-i/--index` option is no longer used/relevant with super\_fetch.
50
+ - Don't display "Delete/Retry All" buttons when filtering in Web UI [#3243]
51
+ - Reimplement Sidekiq::JobSet#find\_job with ZSCAN [#3197]
52
+
53
+ 3.4.0
54
+ ---------
55
+
56
+ - Introducing the newest reliable fetching algorithm: `super_fetch`! This
57
+ algorithm will replace reliable\_fetch in Pro 4.0. super\_fetch is
58
+ bullet-proof across all environments, no longer requiring stable
59
+ hostnames or an index to be set per-process. [#3077]
60
+ ```ruby
61
+ Sidekiq.configure_server do |config|
62
+ config.super_fetch!
63
+ end
64
+ ```
65
+ Thank you to @jonhyman for code review and the Sidekiq Pro customers that
66
+ beta tested super\_fetch.
67
+
68
+ 3.3.3
69
+ ---------
70
+
71
+ - Update Web UI extension to work with Sidekiq 4.2.0's new Web UI. [#3075]
72
+
73
+ 3.3.2
74
+ ---------
75
+
76
+ - Minimize batch memory usage after success [#3083]
77
+ - Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
78
+
79
+ 3.3.1
80
+ ---------
81
+
82
+ - If environment is unset, treat it as development so reliable\_fetch works as before 3.2.2.
83
+
84
+ 3.3.0
85
+ ---------
86
+
87
+ - Don't delete batches immediately upon success but set a 24 hr expiry, this allows
88
+ Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
89
+ - New `Sidekiq::PendingSet#destroy(jid)` API to remove poison pill jobs [#3015]
90
+
91
+ 3.2.2
92
+ ---------
93
+
94
+ - A default value for -i is only set in development now, staging or
95
+ other environments must set an index if you wish to use reliable\_fetch. [#2971]
96
+ - Fix nil dereference when checking for jobs over timeout in timed\_fetch
97
+
98
+
99
+ 3.2.1
100
+ ---------
101
+
102
+ - timed\_fetch now works with namespaces. [ryansch]
103
+
104
+
105
+ 3.2.0
106
+ ---------
107
+
108
+ - Fixed detection of missing batches, `NoSuchBatch` should be raised
109
+ properly now if `Sidekiq::Batch.new(bid)` is called on a batch no
110
+ longer in Redis.
111
+ - Remove support for Pro 1.x format batches. This version will no
112
+ longer seamlessly process batches created with Sidekiq Pro 1.x.
113
+ As always, upgrade one major version at a time to ensure a smooth
114
+ transition.
115
+ - Fix edge case where a parent batch could expire before a child batch
116
+ was finished processing, leading to missing batches [#2889]
117
+
118
+ 2.1.5
119
+ ---------
120
+
121
+ - Fix edge case where a parent batch could expire before a child batch
122
+ was finished processing, leading to missing batches [#2889]
123
+
124
+ 3.1.0
125
+ ---------
126
+
127
+ - New container-friendly fetch algorithm: `timed_fetch`. See the
128
+ [wiki documentation](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server)
129
+ for trade offs between the two reliability options. You should
130
+ use this if you are on Heroku, Docker, Amazon ECS or EBS or
131
+ another container-based system.
132
+
133
+
134
+ 3.0.6
135
+ ---------
136
+
137
+ - Fix race condition on reliable fetch shutdown
138
+
139
+ 3.0.5
140
+ ---------
141
+
142
+ - Statsd metrics now account for ActiveJob class names
143
+ - Allow reliable fetch internals to be overridden [jonhyman]
144
+
145
+ 3.0.4
146
+ ---------
147
+
148
+ - Queue pausing no longer requires reliable fetch. [#2786]
149
+
150
+ 3.0.3, 2.1.4
151
+ ------------
152
+
153
+ - Convert Lua-based `Sidekiq::Queue#delete_by_class` to Ruby-based, to
154
+ avoid O(N^2) performance and possible Redis failure. [#2806]
155
+
156
+ 3.0.2
157
+ -----------
158
+
159
+ - Make job registration with batch part of the atomic push so batch
160
+ metadata can't get out of sync with the job data. [#2714]
161
+
162
+ 3.0.1
163
+ -----------
164
+
165
+ - Remove a number of Redis version checks since we can assume 2.8+ now.
166
+ - Fix expiring jobs client middleware not loaded on server
167
+
168
+ 3.0.0
169
+ -----------
170
+
171
+ - See the [Pro 3.0 release notes](Pro-3.0-Upgrade.md).
172
+
173
+ 2.1.3
174
+ -----------
175
+
176
+ - Don't enable strict priority if using weighted queueing like `-q a,1 -q b,1`
177
+ - Safer JSON mangling in Lua [#2639]
178
+
179
+ 2.1.2
180
+ -----------
181
+
182
+ - Lock Sidekiq Pro 2.x to Sidekiq 3.x.
183
+
184
+ 2.1.1
185
+ -----------
186
+
187
+ - Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
188
+
189
+
190
+ 2.1.0
191
+ -----------
192
+
193
+ - Explicit support for sharding batches. You list your Redis shards and
194
+ Sidekiq Pro will randomly spread batches across the shards. The BID
195
+ will indicate which shard contains the batch data. Jobs within a
196
+ batch may be spread across all shards too. [#2548, jonhyman]
197
+ - Officially deprecate Sidekiq::Notifications code. Notifications have
198
+ been undocumented for months now. [#2575]
199
+
200
+
201
+ 2.0.8
202
+ -----------
203
+
204
+ - Fix reliable scheduler mangling large numeric arguments. Lua's CJSON
205
+ library cannot accurately encode numbers larger than 14 digits! [#2478]
206
+
207
+ 2.0.7
208
+ -----------
209
+
210
+ - Optimize delete of enormous batches (100,000s of jobs) [#2458]
211
+
212
+ 2.0.6, 1.9.3
213
+ --------------
214
+
215
+ - CSRF protection in Sidekiq 3.4.2 broke job filtering in the Web UI [#2442]
216
+ - Sidekiq Pro 1.x is now limited to Sidekiq < 3.5.0.
217
+
218
+ 2.0.5
219
+ -----------
220
+
221
+ - Atomic scheduler now sets `enqueued_at` [#2414]
222
+ - Batches now account for jobs which are stopped by client middleware [#2406]
223
+ - Ignore redundant calls to `Sidekiq::Client.reliable_push!` [#2408]
224
+
225
+ 2.0.4
226
+ -----------
227
+
228
+ - Reliable push now supports sharding [#2409]
229
+ - Reliable push now only catches Redis exceptions [#2307]
230
+
231
+ 2.0.3
232
+ -----------
233
+
234
+ - Display Batch callback data on the Batch details page. [#2347]
235
+ - Fix incompatibility with Pro Web and Rack middleware. [#2344] Thank
236
+ you to Jason Clark for the tip on how to fix it.
237
+
238
+ 2.0.2
239
+ -----------
240
+
241
+ - Multiple Web UIs can now run in the same process. [#2267] If you have
242
+ multiple Redis shards, you can mount UIs for all in the same process:
243
+ ```ruby
244
+ POOL1 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6379/0") }
245
+ POOL2 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6378/0") }
246
+
247
+ mount Sidekiq::Pro::Web => '/sidekiq' # default
248
+ mount Sidekiq::Pro::Web.with(redis_pool: POOL1), at: '/sidekiq1', as: 'sidekiq1' # shard1
249
+ mount Sidekiq::Pro::Web.with(redis_pool: POOL2), at: '/sidekiq2', as: 'sidekiq2' # shard2
250
+ ```
251
+ - **SECURITY** Fix batch XSS in error data. Thanks to moneybird.com for
252
+ reporting the issue.
253
+
254
+ 2.0.1
255
+ -----------
256
+
257
+ - Add `batch.callback_queue` so batch callbacks can use a higher
258
+ priority queue than jobs. [#2200]
259
+ - Gracefully recover if someone runs `SCRIPT FLUSH` on Redis. [#2240]
260
+ - Ignore errors when attempting `bulk_requeue`, allowing clean shutdown
261
+
262
+ 2.0.0
263
+ -----------
264
+
265
+ - See [the Upgrade Notes](Pro-2.0-Upgrade.md) for detailed notes.
266
+
267
+ 1.9.2
268
+ -----------
269
+
270
+ - As of 1/1/2015, Sidekiq Pro is hosted on a new dedicated server.
271
+ Happy new year and let's hope for 100% uptime!
272
+ - Fix bug in reliable\_fetch where jobs could be duplicated if a Sidekiq
273
+ process crashed and you were using weighted queues. [#2120]
274
+
275
+ 1.9.1
276
+ -----------
277
+
278
+ - **SECURITY** Fix XSS in batch description, thanks to intercom.io for reporting the
279
+ issue. If you don't use batch descriptions, you don't need the fix.
280
+
281
+ 1.9.0
282
+ -----------
283
+
284
+ - Add new expiring jobs feature [#1982]
285
+ - Show batch expiration on Batch details page [#1981]
286
+ - Add '$' batch success token to the pubsub support. [#1953]
287
+
288
+
289
+ 1.8.0
290
+ -----------
291
+
292
+ - Fix race condition where Batches can complete
293
+ before they have been fully defined or only half-defined. Requires
294
+ Sidekiq 3.2.3. [#1919]
295
+
296
+
297
+ 1.7.6
298
+ -----------
299
+
300
+ - Quick release to verify #1919
301
+
302
+
303
+ 1.7.5
304
+ -----------
305
+
306
+ - Fix job filtering within the Dead tab.
307
+ - Add APIs and wiki documentation for invalidating jobs within a batch.
308
+
309
+
310
+ 1.7.4
311
+ -----------
312
+
313
+ - Awesome ANSI art startup banner!
314
+
315
+
316
+ 1.7.3
317
+ -----------
318
+
319
+ - Batch callbacks should use the same queue as the associated jobs.
320
+
321
+ 1.7.2
322
+ -----------
323
+
324
+ - **DEPRECATION** Use `Batch#on(:complete)` instead of `Batch#notify`.
325
+ The specific Campfire, HipChat, email and other notification schemes
326
+ will be removed in 2.0.0.
327
+ - Remove batch from UI when successful. [#1745]
328
+ - Convert batch callbacks to be asynchronous jobs for error handling [#1744]
329
+
330
+ 1.7.1
331
+ -----------
332
+
333
+ - Fix for paused queues being processed for a few seconds when starting
334
+ a new Sidekiq process.
335
+ - Add a 5 sec delay when starting reliable fetch on Heroku to minimize
336
+ any duplicate job processing with another process shutting down.
337
+
338
+ 1.7.0
339
+ -----------
340
+
341
+ - Add ability to pause reliable queues via API.
342
+ ```ruby
343
+ q = Sidekiq::Queue.new("critical")
344
+ q.pause!
345
+ q.paused? # => true
346
+ q.unpause!
347
+ ```
348
+
349
+ Sidekiq polls Redis every 10 seconds for paused queues so pausing will take
350
+ a few seconds to take effect.
351
+
352
+ 1.6.0
353
+ -----------
354
+
355
+ - Compatible with Sidekiq 3.
356
+
357
+ 1.5.1
358
+ -----------
359
+
360
+ - Due to a breaking API change in Sidekiq 3.0, this version is limited
361
+ to Sidekiq 2.x.
362
+
363
+ 1.5.0
364
+ -----------
365
+
366
+ - Fix issue on Heroku where reliable fetch could orphan jobs [#1573]
367
+
368
+
369
+ 1.4.3
370
+ -----------
371
+
372
+ - Reverse sorting of Batches in Web UI [#1098]
373
+ - Refactoring for Sidekiq 3.0, Pro now requires Sidekiq 2.17.5
374
+
375
+ 1.4.2
376
+ -----------
377
+
378
+ - Tolerate expired Batches in the web UI.
379
+ - Fix 100% CPU usage when using weighted queues and reliable fetch.
380
+
381
+ 1.4.1
382
+ -----------
383
+
384
+ - Add batch progress bar to batch detail page. [#1398]
385
+ - Fix race condition in initializing Lua scripts
386
+
387
+
388
+ 1.4.0
389
+ -----------
390
+
391
+ - Default batch expiration has been extended to 3 days, from 1 day previously.
392
+ - Batches now sort in the Web UI according to expiry time, not creation time.
393
+ - Add user-configurable batch expiry. If your batches might take longer
394
+ than 72 hours to process, you can extend the expiration date.
395
+
396
+ ```ruby
397
+ b = Sidekiq::Batch.new
398
+ b.expires_in 5.days
399
+ ...
400
+ ```
401
+
402
+ 1.3.2
403
+ -----------
404
+
405
+ - Lazy load Lua scripts so a Redis connection is not required on bootup.
406
+
407
+ 1.3.1
408
+ -----------
409
+
410
+ - Fix a gemspec packaging issue which broke the Batch UI.
411
+
412
+ 1.3.0
413
+ -----------
414
+
415
+ Thanks to @jonhyman for his contributions to this Sidekiq Pro release.
416
+
417
+ This release includes new functionality based on the SCAN command newly
418
+ added to Redis 2.8. Pro still works with Redis 2.4 but some
419
+ functionality will be unavailable.
420
+
421
+ - Job Filtering in the Web UI!
422
+ You can now filter retries and scheduled jobs in the Web UI so you
423
+ only see the jobs relevant to your needs. Queues cannot be filtered;
424
+ Redis does not provide the same SCAN operation on the LIST type.
425
+ **Redis 2.8**
426
+ ![Filtering](https://f.cloud.github.com/assets/2911/1619465/f47529f2-5657-11e3-8cd1-33899eb72aad.png)
427
+ - SCAN support in the Sidekiq::SortedSet API. Here's an example that
428
+ finds all jobs which contain the substring "Warehouse::OrderShip"
429
+ and deletes all matching retries. If the set is large, this API
430
+ will be **MUCH** faster than standard iteration using each.
431
+ **Redis 2.8**
432
+ ```ruby
433
+ Sidekiq::RetrySet.new.scan("Warehouse::OrderShip") do |job|
434
+ job.delete
435
+ end
436
+ ```
437
+
438
+ - Sidekiq::Batch#jobs now returns the set of JIDs added to the batch.
439
+ - Sidekiq::Batch#jids returns the complete set of JIDs associated with the batch.
440
+ - Sidekiq::Batch#remove\_jobs(jid, jid, ...) removes JIDs from the set, allowing early termination of jobs if they become irrelevant according to application logic.
441
+ - Sidekiq::Batch#include?(jid) allows jobs to check if they are still
442
+ relevant to a Batch and exit early if not.
443
+ - Sidekiq::SortedSet#find\_job(jid) now uses server-side Lua if possible **Redis 2.6** [jonhyman]
444
+ - The statsd integration now sets global job counts:
445
+ ```ruby
446
+ jobs.count
447
+ jobs.success
448
+ jobs.failure
449
+ ```
450
+
451
+ - Change shutdown logic to push leftover jobs in the private queue back
452
+ into the public queue when shutting down with Reliable Fetch. This
453
+ allows the safe decommission of a Sidekiq Pro process when autoscaling. [jonhyman]
454
+ - Add support for weighted random fetching with Reliable Fetch [jonhyman]
455
+ - Pro now requires Sidekiq 2.17.0
456
+
457
+ 1.2.5
458
+ -----------
459
+
460
+ - Convert Batch UI to use Sidekiq 2.16's support for extension localization.
461
+ - Update reliable\_push to work with Sidekiq::Client refactoring in 2.16
462
+ - Pro now requires Sidekiq 2.16.0
463
+
464
+ 1.2.4
465
+ -----------
466
+
467
+ - Convert Batch UI to Bootstrap 3
468
+ - Pro now requires Sidekiq 2.15.0
469
+ - Add Sidekiq::Batch::Status#delete [#1205]
470
+
471
+ 1.2.3
472
+ -----------
473
+
474
+ - Pro now requires Sidekiq 2.14.0
475
+ - Fix bad exception handling in batch callbacks [#1134]
476
+ - Convert Batch UI to ERB
477
+
478
+ 1.2.2
479
+ -----------
480
+
481
+ - Problem with reliable fetch which could lead to lost jobs when Sidekiq
482
+ is shut down normally. Thanks to MikaelAmborn for the report. [#1109]
483
+
484
+ 1.2.1
485
+ -----------
486
+
487
+ - Forgot to push paging code necessary for `delete_job` performance.
488
+
489
+ 1.2.0
490
+ -----------
491
+
492
+ - **LEAK** Fix batch key which didn't expire in Redis. Keys match
493
+ /b-[a-f0-9]{16}-pending/, e.g. "b-4f55163ddba10aa0-pending" [#1057]
494
+ - **Reliable fetch now supports multiple queues**, using the algorithm spec'd
495
+ by @jackrg [#1102]
496
+ - Fix issue with reliable\_push where it didn't return the JID for a pushed
497
+ job when sending previously cached jobs to Redis.
498
+ - Add fast Sidekiq::Queue#delete\_job(jid) API which leverages Lua so job lookup is
499
+ 100% server-side. Benchmark vs Sidekiq's Job#delete API. **Redis 2.6**
500
+
501
+ ```
502
+ Sidekiq Pro API
503
+ 0.030000 0.020000 0.050000 ( 1.640659)
504
+ Sidekiq API
505
+ 17.250000 2.220000 19.470000 ( 22.193300)
506
+ ```
507
+
508
+ - Add fast Sidekiq::Queue#delete\_by\_class(klass) API to remove all
509
+ jobs of a given type. Uses server-side Lua for performance. **Redis 2.6**
510
+
511
+ 1.1.0
512
+ -----------
513
+
514
+ - New `sidekiq/pro/reliable_push` which makes Sidekiq::Client resiliant
515
+ to Redis network failures. [#793]
516
+ - Move `sidekiq/reliable_fetch` to `sidekiq/pro/reliable_fetch`
517
+
518
+
519
+ 1.0.0
520
+ -----------
521
+
522
+ - Sidekiq Pro changelog moved to mperham/sidekiq for public visibility.
523
+ - Add new Rack endpoint for easy polling of batch status via JavaScript. See `sidekiq/rack/batch_status`
524
+
525
+ 0.9.3
526
+ -----------
527
+
528
+ - Fix bad /batches path in Web UI
529
+ - Fix Sinatra conflict with sidekiq-failures
530
+
531
+ 0.9.2
532
+ -----------
533
+
534
+ - Fix issue with lifecycle notifications not firing.
535
+
536
+ 0.9.1
537
+ -----------
538
+
539
+ - Update due to Sidekiq API changes.
540
+
541
+ 0.9.0
542
+ -----------
543
+
544
+ - Rearchitect Sidekiq's Fetch code to support different fetch
545
+ strategies. Add a ReliableFetch strategy which works with Redis'
546
+ RPOPLPUSH to ensure we don't lose messages, even when the Sidekiq
547
+ process crashes unexpectedly. [mperham/sidekiq#607]
548
+
549
+ 0.8.2
550
+ -----------
551
+
552
+ - Reimplement existing notifications using batch on_complete events.
553
+
554
+ 0.8.1
555
+ -----------
556
+
557
+ - Rejigger batch callback notifications.
558
+
559
+
560
+ 0.8.0
561
+ -----------
562
+
563
+ - Add new Batch 'callback' notification support, for in-process
564
+ notification.
565
+ - Symbolize option keys passed to Pony [mperham/sidekiq#603]
566
+ - Batch no longer requires the Web UI since Web UI usage is optional.
567
+ You must require is manually in your Web process:
568
+
569
+ ```ruby
570
+ require 'sidekiq/web'
571
+ require 'sidekiq/batch/web'
572
+ mount Sidekiq::Web => '/sidekiq'
573
+ ```
574
+
575
+
576
+ 0.7.1
577
+ -----------
578
+
579
+ - Worker instances can access the associated jid and bid via simple
580
+ accessors.
581
+ - Batches can now be modified while being processed so, e.g. a batch
582
+ job can add additional jobs to its own batch.
583
+
584
+ ```ruby
585
+ def perform(...)
586
+ batch = Sidekiq::Batch.new(bid) # instantiate batch associated with this job
587
+ batch.jobs do
588
+ SomeWorker.perform_async # add another job
589
+ end
590
+ end
591
+ ```
592
+
593
+ - Save error backtraces in batch's failure info for display in Web UI.
594
+ - Clean up email notification a bit.
595
+
596
+
597
+ 0.7.0
598
+ -----------
599
+
600
+ - Add optional batch description
601
+ - Mutable batches. Batches can now be modified to add additional jobs
602
+ at runtime. Example would be a batch job which needs to create more
603
+ jobs based on the data it is processing.
604
+
605
+ ```ruby
606
+ batch = Sidekiq::Batch.new(bid)
607
+ batch.jobs do
608
+ # define more jobs here
609
+ end
610
+ ```
611
+ - Fix issues with symbols vs strings in option hashes
612
+
613
+
614
+ 0.6.1
615
+ -----------
616
+
617
+ - Webhook notification support
618
+
619
+
620
+ 0.6
621
+ -----------
622
+
623
+ - Redis pubsub
624
+ - Email polish
625
+
626
+
627
+ 0.5
628
+ -----------
629
+
630
+ - Batches
631
+ - Notifications
632
+ - Statsd middleware