sidekiq 3.5.4 → 7.2.0

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

Potentially problematic release.


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

Files changed (228) hide show
  1. checksums.yaml +5 -5
  2. data/Changes.md +992 -6
  3. data/LICENSE.txt +9 -0
  4. data/README.md +52 -43
  5. data/bin/sidekiq +22 -4
  6. data/bin/sidekiqload +209 -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/job_spec.rb.erb +6 -0
  11. data/lib/generators/sidekiq/templates/job_test.rb.erb +8 -0
  12. data/lib/sidekiq/api.rb +633 -295
  13. data/lib/sidekiq/capsule.rb +127 -0
  14. data/lib/sidekiq/cli.rb +270 -248
  15. data/lib/sidekiq/client.rb +139 -108
  16. data/lib/sidekiq/component.rb +68 -0
  17. data/lib/sidekiq/config.rb +287 -0
  18. data/lib/sidekiq/deploy.rb +62 -0
  19. data/lib/sidekiq/embedded.rb +61 -0
  20. data/lib/sidekiq/fetch.rb +53 -121
  21. data/lib/sidekiq/job.rb +374 -0
  22. data/lib/sidekiq/job_logger.rb +51 -0
  23. data/lib/sidekiq/job_retry.rb +301 -0
  24. data/lib/sidekiq/job_util.rb +107 -0
  25. data/lib/sidekiq/launcher.rb +241 -69
  26. data/lib/sidekiq/logger.rb +131 -0
  27. data/lib/sidekiq/manager.rb +88 -190
  28. data/lib/sidekiq/metrics/query.rb +155 -0
  29. data/lib/sidekiq/metrics/shared.rb +95 -0
  30. data/lib/sidekiq/metrics/tracking.rb +136 -0
  31. data/lib/sidekiq/middleware/chain.rb +114 -56
  32. data/lib/sidekiq/middleware/current_attributes.rb +95 -0
  33. data/lib/sidekiq/middleware/i18n.rb +8 -7
  34. data/lib/sidekiq/middleware/modules.rb +21 -0
  35. data/lib/sidekiq/monitor.rb +146 -0
  36. data/lib/sidekiq/paginator.rb +29 -16
  37. data/lib/sidekiq/processor.rb +238 -118
  38. data/lib/sidekiq/rails.rb +57 -27
  39. data/lib/sidekiq/redis_client_adapter.rb +111 -0
  40. data/lib/sidekiq/redis_connection.rb +49 -50
  41. data/lib/sidekiq/ring_buffer.rb +29 -0
  42. data/lib/sidekiq/scheduled.rb +173 -52
  43. data/lib/sidekiq/sd_notify.rb +149 -0
  44. data/lib/sidekiq/systemd.rb +24 -0
  45. data/lib/sidekiq/testing/inline.rb +7 -5
  46. data/lib/sidekiq/testing.rb +197 -65
  47. data/lib/sidekiq/transaction_aware_client.rb +44 -0
  48. data/lib/sidekiq/version.rb +4 -1
  49. data/lib/sidekiq/web/action.rb +93 -0
  50. data/lib/sidekiq/web/application.rb +463 -0
  51. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  52. data/lib/sidekiq/web/helpers.rb +364 -0
  53. data/lib/sidekiq/web/router.rb +104 -0
  54. data/lib/sidekiq/web.rb +113 -216
  55. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  56. data/lib/sidekiq.rb +99 -142
  57. data/sidekiq.gemspec +26 -23
  58. data/web/assets/images/apple-touch-icon.png +0 -0
  59. data/web/assets/javascripts/application.js +163 -74
  60. data/web/assets/javascripts/base-charts.js +106 -0
  61. data/web/assets/javascripts/chart.min.js +13 -0
  62. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  63. data/web/assets/javascripts/dashboard-charts.js +182 -0
  64. data/web/assets/javascripts/dashboard.js +37 -280
  65. data/web/assets/javascripts/metrics.js +298 -0
  66. data/web/assets/stylesheets/application-dark.css +147 -0
  67. data/web/assets/stylesheets/application-rtl.css +153 -0
  68. data/web/assets/stylesheets/application.css +181 -198
  69. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  70. data/web/assets/stylesheets/bootstrap.css +4 -8
  71. data/web/locales/ar.yml +87 -0
  72. data/web/locales/cs.yml +62 -52
  73. data/web/locales/da.yml +60 -53
  74. data/web/locales/de.yml +65 -53
  75. data/web/locales/el.yml +43 -24
  76. data/web/locales/en.yml +86 -62
  77. data/web/locales/es.yml +70 -53
  78. data/web/locales/fa.yml +80 -0
  79. data/web/locales/fr.yml +86 -56
  80. data/web/locales/gd.yml +99 -0
  81. data/web/locales/he.yml +80 -0
  82. data/web/locales/hi.yml +59 -59
  83. data/web/locales/it.yml +53 -53
  84. data/web/locales/ja.yml +78 -56
  85. data/web/locales/ko.yml +52 -52
  86. data/web/locales/lt.yml +83 -0
  87. data/web/locales/nb.yml +61 -61
  88. data/web/locales/nl.yml +52 -52
  89. data/web/locales/pl.yml +45 -45
  90. data/web/locales/pt-br.yml +83 -55
  91. data/web/locales/pt.yml +51 -51
  92. data/web/locales/ru.yml +68 -60
  93. data/web/locales/sv.yml +53 -53
  94. data/web/locales/ta.yml +60 -60
  95. data/web/locales/uk.yml +62 -61
  96. data/web/locales/ur.yml +80 -0
  97. data/web/locales/vi.yml +83 -0
  98. data/web/locales/zh-cn.yml +43 -16
  99. data/web/locales/zh-tw.yml +42 -8
  100. data/web/views/_footer.erb +10 -9
  101. data/web/views/_job_info.erb +26 -5
  102. data/web/views/_metrics_period_select.erb +12 -0
  103. data/web/views/_nav.erb +6 -20
  104. data/web/views/_paging.erb +3 -1
  105. data/web/views/_poll_link.erb +3 -6
  106. data/web/views/_summary.erb +7 -7
  107. data/web/views/busy.erb +87 -28
  108. data/web/views/dashboard.erb +51 -21
  109. data/web/views/dead.erb +4 -4
  110. data/web/views/filtering.erb +7 -0
  111. data/web/views/layout.erb +15 -5
  112. data/web/views/metrics.erb +91 -0
  113. data/web/views/metrics_for_job.erb +59 -0
  114. data/web/views/morgue.erb +25 -22
  115. data/web/views/queue.erb +35 -25
  116. data/web/views/queues.erb +23 -7
  117. data/web/views/retries.erb +28 -23
  118. data/web/views/retry.erb +5 -5
  119. data/web/views/scheduled.erb +19 -17
  120. data/web/views/scheduled_job_info.erb +1 -1
  121. metadata +86 -268
  122. data/.gitignore +0 -12
  123. data/.travis.yml +0 -16
  124. data/3.0-Upgrade.md +0 -70
  125. data/COMM-LICENSE +0 -95
  126. data/Contributing.md +0 -32
  127. data/Ent-Changes.md +0 -39
  128. data/Gemfile +0 -27
  129. data/LICENSE +0 -9
  130. data/Pro-2.0-Upgrade.md +0 -138
  131. data/Pro-Changes.md +0 -454
  132. data/Rakefile +0 -9
  133. data/bin/sidekiqctl +0 -93
  134. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +0 -6
  135. data/lib/generators/sidekiq/templates/worker_test.rb.erb +0 -8
  136. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  137. data/lib/sidekiq/actor.rb +0 -39
  138. data/lib/sidekiq/core_ext.rb +0 -105
  139. data/lib/sidekiq/exception_handler.rb +0 -30
  140. data/lib/sidekiq/extensions/action_mailer.rb +0 -56
  141. data/lib/sidekiq/extensions/active_record.rb +0 -39
  142. data/lib/sidekiq/extensions/class_methods.rb +0 -39
  143. data/lib/sidekiq/extensions/generic_proxy.rb +0 -24
  144. data/lib/sidekiq/logging.rb +0 -104
  145. data/lib/sidekiq/middleware/server/active_record.rb +0 -13
  146. data/lib/sidekiq/middleware/server/logging.rb +0 -40
  147. data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -206
  148. data/lib/sidekiq/util.rb +0 -68
  149. data/lib/sidekiq/web_helpers.rb +0 -249
  150. data/lib/sidekiq/worker.rb +0 -103
  151. data/test/config.yml +0 -9
  152. data/test/env_based_config.yml +0 -11
  153. data/test/fake_env.rb +0 -0
  154. data/test/fixtures/en.yml +0 -2
  155. data/test/helper.rb +0 -49
  156. data/test/test_api.rb +0 -493
  157. data/test/test_cli.rb +0 -335
  158. data/test/test_client.rb +0 -194
  159. data/test/test_exception_handler.rb +0 -55
  160. data/test/test_extensions.rb +0 -126
  161. data/test/test_fetch.rb +0 -104
  162. data/test/test_logging.rb +0 -34
  163. data/test/test_manager.rb +0 -168
  164. data/test/test_middleware.rb +0 -159
  165. data/test/test_processor.rb +0 -237
  166. data/test/test_rails.rb +0 -21
  167. data/test/test_redis_connection.rb +0 -126
  168. data/test/test_retry.rb +0 -325
  169. data/test/test_scheduled.rb +0 -114
  170. data/test/test_scheduling.rb +0 -49
  171. data/test/test_sidekiq.rb +0 -99
  172. data/test/test_testing.rb +0 -142
  173. data/test/test_testing_fake.rb +0 -268
  174. data/test/test_testing_inline.rb +0 -93
  175. data/test/test_util.rb +0 -16
  176. data/test/test_web.rb +0 -608
  177. data/test/test_web_helpers.rb +0 -53
  178. data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  179. data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  180. data/web/assets/images/status/active.png +0 -0
  181. data/web/assets/images/status/idle.png +0 -0
  182. data/web/assets/javascripts/locales/README.md +0 -27
  183. data/web/assets/javascripts/locales/jquery.timeago.ar.js +0 -96
  184. data/web/assets/javascripts/locales/jquery.timeago.bg.js +0 -18
  185. data/web/assets/javascripts/locales/jquery.timeago.bs.js +0 -49
  186. data/web/assets/javascripts/locales/jquery.timeago.ca.js +0 -18
  187. data/web/assets/javascripts/locales/jquery.timeago.cs.js +0 -18
  188. data/web/assets/javascripts/locales/jquery.timeago.cy.js +0 -20
  189. data/web/assets/javascripts/locales/jquery.timeago.da.js +0 -18
  190. data/web/assets/javascripts/locales/jquery.timeago.de.js +0 -18
  191. data/web/assets/javascripts/locales/jquery.timeago.el.js +0 -18
  192. data/web/assets/javascripts/locales/jquery.timeago.en-short.js +0 -20
  193. data/web/assets/javascripts/locales/jquery.timeago.en.js +0 -20
  194. data/web/assets/javascripts/locales/jquery.timeago.es.js +0 -18
  195. data/web/assets/javascripts/locales/jquery.timeago.et.js +0 -18
  196. data/web/assets/javascripts/locales/jquery.timeago.fa.js +0 -22
  197. data/web/assets/javascripts/locales/jquery.timeago.fi.js +0 -28
  198. data/web/assets/javascripts/locales/jquery.timeago.fr-short.js +0 -16
  199. data/web/assets/javascripts/locales/jquery.timeago.fr.js +0 -17
  200. data/web/assets/javascripts/locales/jquery.timeago.he.js +0 -18
  201. data/web/assets/javascripts/locales/jquery.timeago.hr.js +0 -49
  202. data/web/assets/javascripts/locales/jquery.timeago.hu.js +0 -18
  203. data/web/assets/javascripts/locales/jquery.timeago.hy.js +0 -18
  204. data/web/assets/javascripts/locales/jquery.timeago.id.js +0 -18
  205. data/web/assets/javascripts/locales/jquery.timeago.it.js +0 -16
  206. data/web/assets/javascripts/locales/jquery.timeago.ja.js +0 -19
  207. data/web/assets/javascripts/locales/jquery.timeago.ko.js +0 -17
  208. data/web/assets/javascripts/locales/jquery.timeago.lt.js +0 -20
  209. data/web/assets/javascripts/locales/jquery.timeago.mk.js +0 -20
  210. data/web/assets/javascripts/locales/jquery.timeago.nl.js +0 -20
  211. data/web/assets/javascripts/locales/jquery.timeago.no.js +0 -18
  212. data/web/assets/javascripts/locales/jquery.timeago.pl.js +0 -31
  213. data/web/assets/javascripts/locales/jquery.timeago.pt-br.js +0 -16
  214. data/web/assets/javascripts/locales/jquery.timeago.pt.js +0 -16
  215. data/web/assets/javascripts/locales/jquery.timeago.ro.js +0 -18
  216. data/web/assets/javascripts/locales/jquery.timeago.rs.js +0 -49
  217. data/web/assets/javascripts/locales/jquery.timeago.ru.js +0 -34
  218. data/web/assets/javascripts/locales/jquery.timeago.sk.js +0 -18
  219. data/web/assets/javascripts/locales/jquery.timeago.sl.js +0 -44
  220. data/web/assets/javascripts/locales/jquery.timeago.sv.js +0 -18
  221. data/web/assets/javascripts/locales/jquery.timeago.th.js +0 -20
  222. data/web/assets/javascripts/locales/jquery.timeago.tr.js +0 -16
  223. data/web/assets/javascripts/locales/jquery.timeago.uk.js +0 -34
  224. data/web/assets/javascripts/locales/jquery.timeago.uz.js +0 -19
  225. data/web/assets/javascripts/locales/jquery.timeago.zh-cn.js +0 -20
  226. data/web/assets/javascripts/locales/jquery.timeago.zh-tw.js +0 -20
  227. data/web/views/_poll_js.erb +0 -5
  228. /data/web/assets/images/{status-sd8051fd480.png → status.png} +0 -0
data/Pro-Changes.md DELETED
@@ -1,454 +0,0 @@
1
- Sidekiq Pro Changelog
2
- =======================
3
-
4
- Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
5
-
6
- 2.1.1
7
- -----------
8
-
9
- - Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
10
-
11
-
12
- 2.1.0
13
- -----------
14
-
15
- - Explicit support for sharding batches. You list your Redis shards and
16
- Sidekiq Pro will randomly spread batches across the shards. The BID
17
- will indicate which shard contains the batch data. Jobs within a
18
- batch may be spread across all shards too. [#2548, jonhyman]
19
- - Officially deprecate Sidekiq::Notifications code. Notifications have
20
- been undocumented for months now. [#2575]
21
-
22
-
23
- 2.0.8
24
- -----------
25
-
26
- - Fix reliable scheduler mangling large numeric arguments. Lua's CJSON
27
- library cannot accurately encode numbers larger than 14 digits! [#2478]
28
-
29
- 2.0.7
30
- -----------
31
-
32
- - Optimize delete of enormous batches (100,000s of jobs) [#2458]
33
-
34
- 2.0.6, 1.9.3
35
- --------------
36
-
37
- - CSRF protection in Sidekiq 3.4.2 broke job filtering in the Web UI [#2442]
38
- - Sidekiq Pro 1.x is now limited to Sidekiq < 3.5.0.
39
-
40
- 2.0.5
41
- -----------
42
-
43
- - Atomic scheduler now sets `enqueued_at` [#2414]
44
- - Batches now account for jobs which are stopped by client middleware [#2406]
45
- - Ignore redundant calls to `Sidekiq::Client.reliable_push!` [#2408]
46
-
47
- 2.0.4
48
- -----------
49
-
50
- - Reliable push now supports sharding [#2409]
51
- - Reliable push now only catches Redis exceptions [#2307]
52
-
53
- 2.0.3
54
- -----------
55
-
56
- - Display Batch callback data on the Batch details page. [#2347]
57
- - Fix incompatibility with Pro Web and Rack middleware. [#2344] Thank
58
- you to Jason Clark for the tip on how to fix it.
59
-
60
- 2.0.2
61
- -----------
62
-
63
- - Multiple Web UIs can now run in the same process. [#2267] If you have
64
- multiple Redis shards, you can mount UIs for all in the same process:
65
- ```ruby
66
- POOL1 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6379/0") }
67
- POOL2 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6378/0") }
68
-
69
- mount Sidekiq::Pro::Web => '/sidekiq' # default
70
- mount Sidekiq::Pro::Web.with(redis_pool: POOL1), at: '/sidekiq1', as: 'sidekiq1' # shard1
71
- mount Sidekiq::Pro::Web.with(redis_pool: POOL2), at: '/sidekiq2', as: 'sidekiq2' # shard2
72
- ```
73
- - **SECURITY** Fix batch XSS in error data. Thanks to moneybird.com for
74
- reporting the issue.
75
-
76
- 2.0.1
77
- -----------
78
-
79
- - Add `batch.callback_queue` so batch callbacks can use a higher
80
- priority queue than jobs. [#2200]
81
- - Gracefully recover if someone runs `SCRIPT FLUSH` on Redis. [#2240]
82
- - Ignore errors when attempting `bulk_requeue`, allowing clean shutdown
83
-
84
- 2.0.0
85
- -----------
86
-
87
- - See [the Upgrade Notes](Pro-2.0-Upgrade.md) for detailed notes.
88
-
89
- 1.9.2
90
- -----------
91
-
92
- - As of 1/1/2015, Sidekiq Pro is hosted on a new dedicated server.
93
- Happy new year and let's hope for 100% uptime!
94
- - Fix bug in reliable\_fetch where jobs could be duplicated if a Sidekiq
95
- process crashed and you were using weighted queues. [#2120]
96
-
97
- 1.9.1
98
- -----------
99
-
100
- - **SECURITY** Fix XSS in batch description, thanks to intercom.io for reporting the
101
- issue. If you don't use batch descriptions, you don't need the fix.
102
-
103
- 1.9.0
104
- -----------
105
-
106
- - Add new expiring jobs feature [#1982]
107
- - Show batch expiration on Batch details page [#1981]
108
- - Add '$' batch success token to the pubsub support. [#1953]
109
-
110
-
111
- 1.8.0
112
- -----------
113
-
114
- - Fix race condition where Batches can complete
115
- before they have been fully defined or only half-defined. Requires
116
- Sidekiq 3.2.3. [#1919]
117
-
118
-
119
- 1.7.6
120
- -----------
121
-
122
- - Quick release to verify #1919
123
-
124
-
125
- 1.7.5
126
- -----------
127
-
128
- - Fix job filtering within the Dead tab.
129
- - Add APIs and wiki documentation for invalidating jobs within a batch.
130
-
131
-
132
- 1.7.4
133
- -----------
134
-
135
- - Awesome ANSI art startup banner!
136
-
137
-
138
- 1.7.3
139
- -----------
140
-
141
- - Batch callbacks should use the same queue as the associated jobs.
142
-
143
- 1.7.2
144
- -----------
145
-
146
- - **DEPRECATION** Use `Batch#on(:complete)` instead of `Batch#notify`.
147
- The specific Campfire, HipChat, email and other notification schemes
148
- will be removed in 2.0.0.
149
- - Remove batch from UI when successful. [#1745]
150
- - Convert batch callbacks to be asynchronous jobs for error handling [#1744]
151
-
152
- 1.7.1
153
- -----------
154
-
155
- - Fix for paused queues being processed for a few seconds when starting
156
- a new Sidekiq process.
157
- - Add a 5 sec delay when starting reliable fetch on Heroku to minimize
158
- any duplicate job processing with another process shutting down.
159
-
160
- 1.7.0
161
- -----------
162
-
163
- - Add ability to pause reliable queues via API.
164
- ```ruby
165
- q = Sidekiq::Queue.new("critical")
166
- q.pause!
167
- q.paused? # => true
168
- q.unpause!
169
- ```
170
-
171
- Sidekiq polls Redis every 10 seconds for paused queues so pausing will take
172
- a few seconds to take effect.
173
-
174
- 1.6.0
175
- -----------
176
-
177
- - Compatible with Sidekiq 3.
178
-
179
- 1.5.1
180
- -----------
181
-
182
- - Due to a breaking API change in Sidekiq 3.0, this version is limited
183
- to Sidekiq 2.x.
184
-
185
- 1.5.0
186
- -----------
187
-
188
- - Fix issue on Heroku where reliable fetch could orphan jobs [#1573]
189
-
190
-
191
- 1.4.3
192
- -----------
193
-
194
- - Reverse sorting of Batches in Web UI [#1098]
195
- - Refactoring for Sidekiq 3.0, Pro now requires Sidekiq 2.17.5
196
-
197
- 1.4.2
198
- -----------
199
-
200
- - Tolerate expired Batches in the web UI.
201
- - Fix 100% CPU usage when using weighted queues and reliable fetch.
202
-
203
- 1.4.1
204
- -----------
205
-
206
- - Add batch progress bar to batch detail page. [#1398]
207
- - Fix race condition in initializing Lua scripts
208
-
209
-
210
- 1.4.0
211
- -----------
212
-
213
- - Default batch expiration has been extended to 3 days, from 1 day previously.
214
- - Batches now sort in the Web UI according to expiry time, not creation time.
215
- - Add user-configurable batch expiry. If your batches might take longer
216
- than 72 hours to process, you can extend the expiration date.
217
-
218
- ```ruby
219
- b = Sidekiq::Batch.new
220
- b.expires_in 5.days
221
- ...
222
- ```
223
-
224
- 1.3.2
225
- -----------
226
-
227
- - Lazy load Lua scripts so a Redis connection is not required on bootup.
228
-
229
- 1.3.1
230
- -----------
231
-
232
- - Fix a gemspec packaging issue which broke the Batch UI.
233
-
234
- 1.3.0
235
- -----------
236
-
237
- Thanks to @jonhyman for his contributions to this Sidekiq Pro release.
238
-
239
- This release includes new functionality based on the SCAN command newly
240
- added to Redis 2.8. Pro still works with Redis 2.4 but some
241
- functionality will be unavailable.
242
-
243
- - Job Filtering in the Web UI!
244
- You can now filter retries and scheduled jobs in the Web UI so you
245
- only see the jobs relevant to your needs. Queues cannot be filtered;
246
- Redis does not provide the same SCAN operation on the LIST type.
247
- **Redis 2.8**
248
- ![Filtering](https://f.cloud.github.com/assets/2911/1619465/f47529f2-5657-11e3-8cd1-33899eb72aad.png)
249
- - SCAN support in the Sidekiq::SortedSet API. Here's an example that
250
- finds all jobs which contain the substring "Warehouse::OrderShip"
251
- and deletes all matching retries. If the set is large, this API
252
- will be **MUCH** faster than standard iteration using each.
253
- **Redis 2.8**
254
- ```ruby
255
- Sidekiq::RetrySet.new.scan("Warehouse::OrderShip") do |job|
256
- job.delete
257
- end
258
- ```
259
-
260
- - Sidekiq::Batch#jobs now returns the set of JIDs added to the batch.
261
- - Sidekiq::Batch#jids returns the complete set of JIDs associated with the batch.
262
- - Sidekiq::Batch#remove\_jobs(jid, jid, ...) removes JIDs from the set, allowing early termination of jobs if they become irrelevant according to application logic.
263
- - Sidekiq::Batch#include?(jid) allows jobs to check if they are still
264
- relevant to a Batch and exit early if not.
265
- - Sidekiq::SortedSet#find\_job(jid) now uses server-side Lua if possible **Redis 2.6** [jonhyman]
266
- - The statsd integration now sets global job counts:
267
- ```ruby
268
- jobs.count
269
- jobs.success
270
- jobs.failure
271
- ```
272
-
273
- - Change shutdown logic to push leftover jobs in the private queue back
274
- into the public queue when shutting down with Reliable Fetch. This
275
- allows the safe decommission of a Sidekiq Pro process when autoscaling. [jonhyman]
276
- - Add support for weighted random fetching with Reliable Fetch [jonhyman]
277
- - Pro now requires Sidekiq 2.17.0
278
-
279
- 1.2.5
280
- -----------
281
-
282
- - Convert Batch UI to use Sidekiq 2.16's support for extension localization.
283
- - Update reliable\_push to work with Sidekiq::Client refactoring in 2.16
284
- - Pro now requires Sidekiq 2.16.0
285
-
286
- 1.2.4
287
- -----------
288
-
289
- - Convert Batch UI to Bootstrap 3
290
- - Pro now requires Sidekiq 2.15.0
291
- - Add Sidekiq::Batch::Status#delete [#1205]
292
-
293
- 1.2.3
294
- -----------
295
-
296
- - Pro now requires Sidekiq 2.14.0
297
- - Fix bad exception handling in batch callbacks [#1134]
298
- - Convert Batch UI to ERB
299
-
300
- 1.2.2
301
- -----------
302
-
303
- - Problem with reliable fetch which could lead to lost jobs when Sidekiq
304
- is shut down normally. Thanks to MikaelAmborn for the report. [#1109]
305
-
306
- 1.2.1
307
- -----------
308
-
309
- - Forgot to push paging code necessary for `delete_job` performance.
310
-
311
- 1.2.0
312
- -----------
313
-
314
- - **LEAK** Fix batch key which didn't expire in Redis. Keys match
315
- /b-[a-f0-9]{16}-pending/, e.g. "b-4f55163ddba10aa0-pending" [#1057]
316
- - **Reliable fetch now supports multiple queues**, using the algorithm spec'd
317
- by @jackrg [#1102]
318
- - Fix issue with reliable\_push where it didn't return the JID for a pushed
319
- job when sending previously cached jobs to Redis.
320
- - Add fast Sidekiq::Queue#delete\_job(jid) API which leverages Lua so job lookup is
321
- 100% server-side. Benchmark vs Sidekiq's Job#delete API. **Redis 2.6**
322
-
323
- ```
324
- Sidekiq Pro API
325
- 0.030000 0.020000 0.050000 ( 1.640659)
326
- Sidekiq API
327
- 17.250000 2.220000 19.470000 ( 22.193300)
328
- ```
329
-
330
- - Add fast Sidekiq::Queue#delete\_by\_class(klass) API to remove all
331
- jobs of a given type. Uses server-side Lua for performance. **Redis 2.6**
332
-
333
- 1.1.0
334
- -----------
335
-
336
- - New `sidekiq/pro/reliable_push` which makes Sidekiq::Client resiliant
337
- to Redis network failures. [#793]
338
- - Move `sidekiq/reliable_fetch` to `sidekiq/pro/reliable_fetch`
339
-
340
-
341
- 1.0.0
342
- -----------
343
-
344
- - Sidekiq Pro changelog moved to mperham/sidekiq for public visibility.
345
- - Add new Rack endpoint for easy polling of batch status via JavaScript. See `sidekiq/rack/batch_status`
346
-
347
- 0.9.3
348
- -----------
349
-
350
- - Fix bad /batches path in Web UI
351
- - Fix Sinatra conflict with sidekiq-failures
352
-
353
- 0.9.2
354
- -----------
355
-
356
- - Fix issue with lifecycle notifications not firing.
357
-
358
- 0.9.1
359
- -----------
360
-
361
- - Update due to Sidekiq API changes.
362
-
363
- 0.9.0
364
- -----------
365
-
366
- - Rearchitect Sidekiq's Fetch code to support different fetch
367
- strategies. Add a ReliableFetch strategy which works with Redis'
368
- RPOPLPUSH to ensure we don't lose messages, even when the Sidekiq
369
- process crashes unexpectedly. [mperham/sidekiq#607]
370
-
371
- 0.8.2
372
- -----------
373
-
374
- - Reimplement existing notifications using batch on_complete events.
375
-
376
- 0.8.1
377
- -----------
378
-
379
- - Rejigger batch callback notifications.
380
-
381
-
382
- 0.8.0
383
- -----------
384
-
385
- - Add new Batch 'callback' notification support, for in-process
386
- notification.
387
- - Symbolize option keys passed to Pony [mperham/sidekiq#603]
388
- - Batch no longer requires the Web UI since Web UI usage is optional.
389
- You must require is manually in your Web process:
390
-
391
- ```ruby
392
- require 'sidekiq/web'
393
- require 'sidekiq/batch/web'
394
- mount Sidekiq::Web => '/sidekiq'
395
- ```
396
-
397
-
398
- 0.7.1
399
- -----------
400
-
401
- - Worker instances can access the associated jid and bid via simple
402
- accessors.
403
- - Batches can now be modified while being processed so, e.g. a batch
404
- job can add additional jobs to its own batch.
405
-
406
- ```ruby
407
- def perform(...)
408
- batch = Sidekiq::Batch.new(bid) # instantiate batch associated with this job
409
- batch.jobs do
410
- SomeWorker.perform_async # add another job
411
- end
412
- end
413
- ```
414
-
415
- - Save error backtraces in batch's failure info for display in Web UI.
416
- - Clean up email notification a bit.
417
-
418
-
419
- 0.7.0
420
- -----------
421
-
422
- - Add optional batch description
423
- - Mutable batches. Batches can now be modified to add additional jobs
424
- at runtime. Example would be a batch job which needs to create more
425
- jobs based on the data it is processing.
426
-
427
- ```ruby
428
- batch = Sidekiq::Batch.new(bid)
429
- batch.jobs do
430
- # define more jobs here
431
- end
432
- ```
433
- - Fix issues with symbols vs strings in option hashes
434
-
435
-
436
- 0.6.1
437
- -----------
438
-
439
- - Webhook notification support
440
-
441
-
442
- 0.6
443
- -----------
444
-
445
- - Redis pubsub
446
- - Email polish
447
-
448
-
449
- 0.5
450
- -----------
451
-
452
- - Batches
453
- - Notifications
454
- - Statsd middleware
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
- Rake::TestTask.new(:test) do |test|
4
- #SO MUCH NOISE
5
- #test.warning = true
6
- test.pattern = 'test/**/test_*.rb'
7
- end
8
-
9
- task :default => :test
data/bin/sidekiqctl DELETED
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'fileutils'
4
-
5
- class Sidekiqctl
6
- DEFAULT_KILL_TIMEOUT = 10
7
-
8
- attr_reader :stage, :pidfile, :kill_timeout
9
-
10
- def self.print_usage
11
- puts "#{File.basename($0)} - stop a Sidekiq process from the command line."
12
- puts
13
- puts "Usage: #{File.basename($0)} <command> <pidfile> <kill_timeout>"
14
- puts " where <command> is either 'quiet' or 'stop'"
15
- puts " <pidfile> is path to a pidfile"
16
- puts " <kill_timeout> is number of seconds to wait until Sidekiq exits"
17
- puts " (default: #{Sidekiqctl::DEFAULT_KILL_TIMEOUT}), after which Sidekiq will be KILL'd"
18
- puts
19
- puts "Be sure to set the kill_timeout LONGER than Sidekiq's -t timeout. If you want"
20
- puts "to wait 60 seconds for jobs to finish, use `sidekiq -t 60` and `sidekiqctl stop"
21
- puts " path_to_pidfile 61`"
22
- puts
23
- end
24
-
25
- def initialize(stage, pidfile, timeout)
26
- @stage = stage
27
- @pidfile = pidfile
28
- @kill_timeout = timeout
29
-
30
- done('No pidfile given', :error) if !pidfile
31
- done("Pidfile #{pidfile} does not exist", :warn) if !File.exist?(pidfile)
32
- done('Invalid pidfile content', :error) if pid == 0
33
-
34
- fetch_process
35
-
36
- begin
37
- send(stage)
38
- rescue NoMethodError
39
- done "Invalid command: #{stage}", :error
40
- end
41
- end
42
-
43
- def fetch_process
44
- Process.getpgid(pid)
45
- rescue Errno::ESRCH
46
- done "Process doesn't exist", :error
47
- end
48
-
49
- def done(msg, error = nil)
50
- puts msg
51
- exit(exit_signal(error))
52
- end
53
-
54
- def exit_signal(error)
55
- (error == :error) ? 1 : 0
56
- end
57
-
58
- def pid
59
- @pid ||= File.read(pidfile).to_i
60
- end
61
-
62
- def quiet
63
- `kill -USR1 #{pid}`
64
- end
65
-
66
- def stop
67
- `kill -TERM #{pid}`
68
- kill_timeout.times do
69
- begin
70
- Process.getpgid(pid)
71
- rescue Errno::ESRCH
72
- FileUtils.rm_f pidfile
73
- done 'Sidekiq shut down gracefully.'
74
- end
75
- sleep 1
76
- end
77
- `kill -9 #{pid}`
78
- FileUtils.rm_f pidfile
79
- done 'Sidekiq shut down forcefully.'
80
- end
81
- alias_method :shutdown, :stop
82
- end
83
-
84
- if ARGV.length < 2
85
- Sidekiqctl.print_usage
86
- else
87
- stage = ARGV[0]
88
- pidfile = ARGV[1]
89
- timeout = ARGV[2].to_i
90
- timeout = Sidekiqctl::DEFAULT_KILL_TIMEOUT if timeout == 0
91
-
92
- Sidekiqctl.new(stage, pidfile, timeout)
93
- end
@@ -1,6 +0,0 @@
1
- require 'rails_helper'
2
- <% module_namespacing do -%>
3
- RSpec.describe <%= class_name %>Worker, :type => :worker do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
6
- <% end -%>
@@ -1,8 +0,0 @@
1
- require_relative 'test_helper'
2
- <% module_namespacing do -%>
3
- class <%= class_name %>WorkerTest < MiniTest::Unit::TestCase
4
- def test_example
5
- skip "add some examples to (or delete) #{__FILE__}"
6
- end
7
- end
8
- <% end -%>
@@ -1,49 +0,0 @@
1
- require 'rails/generators/named_base'
2
-
3
- module Sidekiq
4
- module Generators # :nodoc:
5
- class WorkerGenerator < ::Rails::Generators::NamedBase # :nodoc:
6
- desc 'This generator creates a Sidekiq Worker in app/workers and a corresponding test'
7
-
8
- check_class_collision suffix: 'Worker'
9
-
10
- def self.default_generator_root
11
- File.dirname(__FILE__)
12
- end
13
-
14
- def create_worker_file
15
- template 'worker.rb.erb', File.join('app/workers', class_path, "#{file_name}_worker.rb")
16
- end
17
-
18
- def create_test_file
19
- if defined?(RSpec)
20
- create_worker_spec
21
- else
22
- create_worker_test
23
- end
24
- end
25
-
26
- private
27
-
28
- def create_worker_spec
29
- template_file = File.join(
30
- 'spec/workers',
31
- class_path,
32
- "#{file_name}_worker_spec.rb"
33
- )
34
- template 'worker_spec.rb.erb', template_file
35
- end
36
-
37
- def create_worker_test
38
- template_file = File.join(
39
- 'test/workers',
40
- class_path,
41
- "#{file_name}_worker_test.rb"
42
- )
43
- template 'worker_test.rb.erb', template_file
44
- end
45
-
46
-
47
- end
48
- end
49
- end
data/lib/sidekiq/actor.rb DELETED
@@ -1,39 +0,0 @@
1
- module Sidekiq
2
- module Actor
3
-
4
- module ClassMethods
5
- def trap_exit(*args)
6
- end
7
- def new_link(*args)
8
- new(*args)
9
- end
10
- end
11
-
12
- module InstanceMethods
13
- def current_actor
14
- self
15
- end
16
- def after(interval)
17
- end
18
- def alive?
19
- @dead = false unless defined?(@dead)
20
- !@dead
21
- end
22
- def terminate
23
- @dead = true
24
- end
25
- def defer
26
- yield
27
- end
28
- end
29
-
30
- def self.included(klass)
31
- if $TESTING
32
- klass.__send__(:include, InstanceMethods)
33
- klass.__send__(:extend, ClassMethods)
34
- else
35
- klass.__send__(:include, Celluloid)
36
- end
37
- end
38
- end
39
- end