sidekiq 4.2.2 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +5 -5
  2. data/Changes.md +516 -0
  3. data/LICENSE +2 -2
  4. data/README.md +23 -36
  5. data/bin/sidekiq +26 -2
  6. data/bin/sidekiqload +28 -38
  7. data/bin/sidekiqmon +8 -0
  8. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +1 -1
  9. data/lib/generators/sidekiq/templates/worker_test.rb.erb +2 -2
  10. data/lib/generators/sidekiq/worker_generator.rb +21 -13
  11. data/lib/sidekiq/api.rb +401 -243
  12. data/lib/sidekiq/cli.rb +228 -212
  13. data/lib/sidekiq/client.rb +76 -53
  14. data/lib/sidekiq/delay.rb +41 -0
  15. data/lib/sidekiq/exception_handler.rb +12 -16
  16. data/lib/sidekiq/extensions/action_mailer.rb +13 -22
  17. data/lib/sidekiq/extensions/active_record.rb +13 -10
  18. data/lib/sidekiq/extensions/class_methods.rb +14 -11
  19. data/lib/sidekiq/extensions/generic_proxy.rb +12 -4
  20. data/lib/sidekiq/fetch.rb +39 -31
  21. data/lib/sidekiq/job.rb +13 -0
  22. data/lib/sidekiq/job_logger.rb +63 -0
  23. data/lib/sidekiq/job_retry.rb +259 -0
  24. data/lib/sidekiq/launcher.rb +170 -71
  25. data/lib/sidekiq/logger.rb +166 -0
  26. data/lib/sidekiq/manager.rb +17 -20
  27. data/lib/sidekiq/middleware/chain.rb +20 -8
  28. data/lib/sidekiq/middleware/current_attributes.rb +52 -0
  29. data/lib/sidekiq/middleware/i18n.rb +5 -7
  30. data/lib/sidekiq/monitor.rb +133 -0
  31. data/lib/sidekiq/paginator.rb +18 -14
  32. data/lib/sidekiq/processor.rb +169 -78
  33. data/lib/sidekiq/rails.rb +41 -36
  34. data/lib/sidekiq/redis_connection.rb +65 -20
  35. data/lib/sidekiq/scheduled.rb +85 -34
  36. data/lib/sidekiq/sd_notify.rb +149 -0
  37. data/lib/sidekiq/systemd.rb +24 -0
  38. data/lib/sidekiq/testing/inline.rb +2 -1
  39. data/lib/sidekiq/testing.rb +52 -26
  40. data/lib/sidekiq/util.rb +48 -15
  41. data/lib/sidekiq/version.rb +2 -1
  42. data/lib/sidekiq/web/action.rb +15 -17
  43. data/lib/sidekiq/web/application.rb +114 -92
  44. data/lib/sidekiq/web/csrf_protection.rb +180 -0
  45. data/lib/sidekiq/web/helpers.rb +151 -83
  46. data/lib/sidekiq/web/router.rb +27 -19
  47. data/lib/sidekiq/web.rb +85 -76
  48. data/lib/sidekiq/worker.rb +233 -43
  49. data/lib/sidekiq.rb +88 -64
  50. data/sidekiq.gemspec +24 -22
  51. data/web/assets/images/apple-touch-icon.png +0 -0
  52. data/web/assets/javascripts/application.js +86 -59
  53. data/web/assets/javascripts/dashboard.js +81 -85
  54. data/web/assets/stylesheets/application-dark.css +147 -0
  55. data/web/assets/stylesheets/application-rtl.css +242 -0
  56. data/web/assets/stylesheets/application.css +319 -141
  57. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  58. data/web/assets/stylesheets/bootstrap.css +2 -2
  59. data/web/locales/ar.yml +87 -0
  60. data/web/locales/de.yml +14 -2
  61. data/web/locales/en.yml +8 -1
  62. data/web/locales/es.yml +22 -5
  63. data/web/locales/fa.yml +80 -0
  64. data/web/locales/fr.yml +10 -3
  65. data/web/locales/he.yml +79 -0
  66. data/web/locales/ja.yml +12 -4
  67. data/web/locales/lt.yml +83 -0
  68. data/web/locales/pl.yml +4 -4
  69. data/web/locales/ru.yml +4 -0
  70. data/web/locales/ur.yml +80 -0
  71. data/web/locales/vi.yml +83 -0
  72. data/web/views/_footer.erb +5 -2
  73. data/web/views/_job_info.erb +4 -3
  74. data/web/views/_nav.erb +4 -18
  75. data/web/views/_paging.erb +1 -1
  76. data/web/views/_poll_link.erb +2 -5
  77. data/web/views/_summary.erb +7 -7
  78. data/web/views/busy.erb +60 -22
  79. data/web/views/dashboard.erb +23 -15
  80. data/web/views/dead.erb +3 -3
  81. data/web/views/layout.erb +14 -3
  82. data/web/views/morgue.erb +19 -12
  83. data/web/views/queue.erb +24 -14
  84. data/web/views/queues.erb +14 -4
  85. data/web/views/retries.erb +22 -13
  86. data/web/views/retry.erb +4 -4
  87. data/web/views/scheduled.erb +7 -4
  88. metadata +44 -194
  89. data/.github/contributing.md +0 -32
  90. data/.github/issue_template.md +0 -4
  91. data/.gitignore +0 -12
  92. data/.travis.yml +0 -12
  93. data/3.0-Upgrade.md +0 -70
  94. data/4.0-Upgrade.md +0 -53
  95. data/COMM-LICENSE +0 -95
  96. data/Ent-Changes.md +0 -146
  97. data/Gemfile +0 -29
  98. data/Pro-2.0-Upgrade.md +0 -138
  99. data/Pro-3.0-Upgrade.md +0 -44
  100. data/Pro-Changes.md +0 -570
  101. data/Rakefile +0 -9
  102. data/bin/sidekiqctl +0 -99
  103. data/code_of_conduct.md +0 -50
  104. data/lib/sidekiq/core_ext.rb +0 -106
  105. data/lib/sidekiq/logging.rb +0 -106
  106. data/lib/sidekiq/middleware/server/active_record.rb +0 -13
  107. data/lib/sidekiq/middleware/server/logging.rb +0 -40
  108. data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -205
  109. data/test/config.yml +0 -9
  110. data/test/env_based_config.yml +0 -11
  111. data/test/fake_env.rb +0 -1
  112. data/test/fixtures/en.yml +0 -2
  113. data/test/helper.rb +0 -75
  114. data/test/test_actors.rb +0 -138
  115. data/test/test_api.rb +0 -528
  116. data/test/test_cli.rb +0 -418
  117. data/test/test_client.rb +0 -266
  118. data/test/test_exception_handler.rb +0 -56
  119. data/test/test_extensions.rb +0 -127
  120. data/test/test_fetch.rb +0 -50
  121. data/test/test_launcher.rb +0 -95
  122. data/test/test_logging.rb +0 -35
  123. data/test/test_manager.rb +0 -50
  124. data/test/test_middleware.rb +0 -158
  125. data/test/test_processor.rb +0 -201
  126. data/test/test_rails.rb +0 -22
  127. data/test/test_redis_connection.rb +0 -132
  128. data/test/test_retry.rb +0 -326
  129. data/test/test_retry_exhausted.rb +0 -149
  130. data/test/test_scheduled.rb +0 -115
  131. data/test/test_scheduling.rb +0 -50
  132. data/test/test_sidekiq.rb +0 -107
  133. data/test/test_testing.rb +0 -143
  134. data/test/test_testing_fake.rb +0 -357
  135. data/test/test_testing_inline.rb +0 -94
  136. data/test/test_util.rb +0 -13
  137. data/test/test_web.rb +0 -666
  138. data/test/test_web_helpers.rb +0 -54
data/Pro-Changes.md DELETED
@@ -1,570 +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
- 3.3.3
7
- ---------
8
-
9
- - Update Web UI extension to work with Sidekiq 4.2.0's new Web UI. [#3075]
10
-
11
- 3.3.2
12
- ---------
13
-
14
- - Minimize batch memory usage after success [#3083]
15
- - Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
16
-
17
- 3.3.1
18
- ---------
19
-
20
- - If environment is unset, treat it as development so reliable\_fetch works as before 3.2.2.
21
-
22
- 3.3.0
23
- ---------
24
-
25
- - Don't delete batches immediately upon success but set a 24 hr expiry, this allows
26
- Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
27
- - New `Sidekiq::PendingSet#destroy(jid)` API to remove poison pill jobs [#3015]
28
-
29
- 3.2.2
30
- ---------
31
-
32
- - A default value for -i is only set in development now, staging or
33
- other environments must set an index if you wish to use reliable\_fetch. [#2971]
34
- - Fix nil dereference when checking for jobs over timeout in timed\_fetch
35
-
36
-
37
- 3.2.1
38
- ---------
39
-
40
- - timed\_fetch now works with namespaces. [ryansch]
41
-
42
-
43
- 3.2.0
44
- ---------
45
-
46
- - Fixed detection of missing batches, `NoSuchBatch` should be raised
47
- properly now if `Sidekiq::Batch.new(bid)` is called on a batch no
48
- longer in Redis.
49
- - Remove support for Pro 1.x format batches. This version will no
50
- longer seamlessly process batches created with Sidekiq Pro 1.x.
51
- As always, upgrade one major version at a time to ensure a smooth
52
- transition.
53
- - Fix edge case where a parent batch could expire before a child batch
54
- was finished processing, leading to missing batches [#2889]
55
-
56
- 2.1.5
57
- ---------
58
-
59
- - Fix edge case where a parent batch could expire before a child batch
60
- was finished processing, leading to missing batches [#2889]
61
-
62
- 3.1.0
63
- ---------
64
-
65
- - New container-friendly fetch algorithm: `timed_fetch`. See the
66
- [wiki documentation](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server)
67
- for trade offs between the two reliability options. You should
68
- use this if you are on Heroku, Docker, Amazon ECS or EBS or
69
- another container-based system.
70
-
71
-
72
- 3.0.6
73
- ---------
74
-
75
- - Fix race condition on reliable fetch shutdown
76
-
77
- 3.0.5
78
- ---------
79
-
80
- - Statsd metrics now account for ActiveJob class names
81
- - Allow reliable fetch internals to be overridden [jonhyman]
82
-
83
- 3.0.4
84
- ---------
85
-
86
- - Queue pausing no longer requires reliable fetch. [#2786]
87
-
88
- 3.0.3, 2.1.4
89
- ------------
90
-
91
- - Convert Lua-based `Sidekiq::Queue#delete_by_class` to Ruby-based, to
92
- avoid O(N^2) performance and possible Redis failure. [#2806]
93
-
94
- 3.0.2
95
- -----------
96
-
97
- - Make job registration with batch part of the atomic push so batch
98
- metadata can't get out of sync with the job data. [#2714]
99
-
100
- 3.0.1
101
- -----------
102
-
103
- - Remove a number of Redis version checks since we can assume 2.8+ now.
104
- - Fix expiring jobs client middleware not loaded on server
105
-
106
- 3.0.0
107
- -----------
108
-
109
- - See the [Pro 3.0 release notes](Pro-3.0-Upgrade.md).
110
-
111
- 2.1.3
112
- -----------
113
-
114
- - Don't enable strict priority if using weighted queueing like `-q a,1 -q b,1`
115
- - Safer JSON mangling in Lua [#2639]
116
-
117
- 2.1.2
118
- -----------
119
-
120
- - Lock Sidekiq Pro 2.x to Sidekiq 3.x.
121
-
122
- 2.1.1
123
- -----------
124
-
125
- - Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
126
-
127
-
128
- 2.1.0
129
- -----------
130
-
131
- - Explicit support for sharding batches. You list your Redis shards and
132
- Sidekiq Pro will randomly spread batches across the shards. The BID
133
- will indicate which shard contains the batch data. Jobs within a
134
- batch may be spread across all shards too. [#2548, jonhyman]
135
- - Officially deprecate Sidekiq::Notifications code. Notifications have
136
- been undocumented for months now. [#2575]
137
-
138
-
139
- 2.0.8
140
- -----------
141
-
142
- - Fix reliable scheduler mangling large numeric arguments. Lua's CJSON
143
- library cannot accurately encode numbers larger than 14 digits! [#2478]
144
-
145
- 2.0.7
146
- -----------
147
-
148
- - Optimize delete of enormous batches (100,000s of jobs) [#2458]
149
-
150
- 2.0.6, 1.9.3
151
- --------------
152
-
153
- - CSRF protection in Sidekiq 3.4.2 broke job filtering in the Web UI [#2442]
154
- - Sidekiq Pro 1.x is now limited to Sidekiq < 3.5.0.
155
-
156
- 2.0.5
157
- -----------
158
-
159
- - Atomic scheduler now sets `enqueued_at` [#2414]
160
- - Batches now account for jobs which are stopped by client middleware [#2406]
161
- - Ignore redundant calls to `Sidekiq::Client.reliable_push!` [#2408]
162
-
163
- 2.0.4
164
- -----------
165
-
166
- - Reliable push now supports sharding [#2409]
167
- - Reliable push now only catches Redis exceptions [#2307]
168
-
169
- 2.0.3
170
- -----------
171
-
172
- - Display Batch callback data on the Batch details page. [#2347]
173
- - Fix incompatibility with Pro Web and Rack middleware. [#2344] Thank
174
- you to Jason Clark for the tip on how to fix it.
175
-
176
- 2.0.2
177
- -----------
178
-
179
- - Multiple Web UIs can now run in the same process. [#2267] If you have
180
- multiple Redis shards, you can mount UIs for all in the same process:
181
- ```ruby
182
- POOL1 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6379/0") }
183
- POOL2 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6378/0") }
184
-
185
- mount Sidekiq::Pro::Web => '/sidekiq' # default
186
- mount Sidekiq::Pro::Web.with(redis_pool: POOL1), at: '/sidekiq1', as: 'sidekiq1' # shard1
187
- mount Sidekiq::Pro::Web.with(redis_pool: POOL2), at: '/sidekiq2', as: 'sidekiq2' # shard2
188
- ```
189
- - **SECURITY** Fix batch XSS in error data. Thanks to moneybird.com for
190
- reporting the issue.
191
-
192
- 2.0.1
193
- -----------
194
-
195
- - Add `batch.callback_queue` so batch callbacks can use a higher
196
- priority queue than jobs. [#2200]
197
- - Gracefully recover if someone runs `SCRIPT FLUSH` on Redis. [#2240]
198
- - Ignore errors when attempting `bulk_requeue`, allowing clean shutdown
199
-
200
- 2.0.0
201
- -----------
202
-
203
- - See [the Upgrade Notes](Pro-2.0-Upgrade.md) for detailed notes.
204
-
205
- 1.9.2
206
- -----------
207
-
208
- - As of 1/1/2015, Sidekiq Pro is hosted on a new dedicated server.
209
- Happy new year and let's hope for 100% uptime!
210
- - Fix bug in reliable\_fetch where jobs could be duplicated if a Sidekiq
211
- process crashed and you were using weighted queues. [#2120]
212
-
213
- 1.9.1
214
- -----------
215
-
216
- - **SECURITY** Fix XSS in batch description, thanks to intercom.io for reporting the
217
- issue. If you don't use batch descriptions, you don't need the fix.
218
-
219
- 1.9.0
220
- -----------
221
-
222
- - Add new expiring jobs feature [#1982]
223
- - Show batch expiration on Batch details page [#1981]
224
- - Add '$' batch success token to the pubsub support. [#1953]
225
-
226
-
227
- 1.8.0
228
- -----------
229
-
230
- - Fix race condition where Batches can complete
231
- before they have been fully defined or only half-defined. Requires
232
- Sidekiq 3.2.3. [#1919]
233
-
234
-
235
- 1.7.6
236
- -----------
237
-
238
- - Quick release to verify #1919
239
-
240
-
241
- 1.7.5
242
- -----------
243
-
244
- - Fix job filtering within the Dead tab.
245
- - Add APIs and wiki documentation for invalidating jobs within a batch.
246
-
247
-
248
- 1.7.4
249
- -----------
250
-
251
- - Awesome ANSI art startup banner!
252
-
253
-
254
- 1.7.3
255
- -----------
256
-
257
- - Batch callbacks should use the same queue as the associated jobs.
258
-
259
- 1.7.2
260
- -----------
261
-
262
- - **DEPRECATION** Use `Batch#on(:complete)` instead of `Batch#notify`.
263
- The specific Campfire, HipChat, email and other notification schemes
264
- will be removed in 2.0.0.
265
- - Remove batch from UI when successful. [#1745]
266
- - Convert batch callbacks to be asynchronous jobs for error handling [#1744]
267
-
268
- 1.7.1
269
- -----------
270
-
271
- - Fix for paused queues being processed for a few seconds when starting
272
- a new Sidekiq process.
273
- - Add a 5 sec delay when starting reliable fetch on Heroku to minimize
274
- any duplicate job processing with another process shutting down.
275
-
276
- 1.7.0
277
- -----------
278
-
279
- - Add ability to pause reliable queues via API.
280
- ```ruby
281
- q = Sidekiq::Queue.new("critical")
282
- q.pause!
283
- q.paused? # => true
284
- q.unpause!
285
- ```
286
-
287
- Sidekiq polls Redis every 10 seconds for paused queues so pausing will take
288
- a few seconds to take effect.
289
-
290
- 1.6.0
291
- -----------
292
-
293
- - Compatible with Sidekiq 3.
294
-
295
- 1.5.1
296
- -----------
297
-
298
- - Due to a breaking API change in Sidekiq 3.0, this version is limited
299
- to Sidekiq 2.x.
300
-
301
- 1.5.0
302
- -----------
303
-
304
- - Fix issue on Heroku where reliable fetch could orphan jobs [#1573]
305
-
306
-
307
- 1.4.3
308
- -----------
309
-
310
- - Reverse sorting of Batches in Web UI [#1098]
311
- - Refactoring for Sidekiq 3.0, Pro now requires Sidekiq 2.17.5
312
-
313
- 1.4.2
314
- -----------
315
-
316
- - Tolerate expired Batches in the web UI.
317
- - Fix 100% CPU usage when using weighted queues and reliable fetch.
318
-
319
- 1.4.1
320
- -----------
321
-
322
- - Add batch progress bar to batch detail page. [#1398]
323
- - Fix race condition in initializing Lua scripts
324
-
325
-
326
- 1.4.0
327
- -----------
328
-
329
- - Default batch expiration has been extended to 3 days, from 1 day previously.
330
- - Batches now sort in the Web UI according to expiry time, not creation time.
331
- - Add user-configurable batch expiry. If your batches might take longer
332
- than 72 hours to process, you can extend the expiration date.
333
-
334
- ```ruby
335
- b = Sidekiq::Batch.new
336
- b.expires_in 5.days
337
- ...
338
- ```
339
-
340
- 1.3.2
341
- -----------
342
-
343
- - Lazy load Lua scripts so a Redis connection is not required on bootup.
344
-
345
- 1.3.1
346
- -----------
347
-
348
- - Fix a gemspec packaging issue which broke the Batch UI.
349
-
350
- 1.3.0
351
- -----------
352
-
353
- Thanks to @jonhyman for his contributions to this Sidekiq Pro release.
354
-
355
- This release includes new functionality based on the SCAN command newly
356
- added to Redis 2.8. Pro still works with Redis 2.4 but some
357
- functionality will be unavailable.
358
-
359
- - Job Filtering in the Web UI!
360
- You can now filter retries and scheduled jobs in the Web UI so you
361
- only see the jobs relevant to your needs. Queues cannot be filtered;
362
- Redis does not provide the same SCAN operation on the LIST type.
363
- **Redis 2.8**
364
- ![Filtering](https://f.cloud.github.com/assets/2911/1619465/f47529f2-5657-11e3-8cd1-33899eb72aad.png)
365
- - SCAN support in the Sidekiq::SortedSet API. Here's an example that
366
- finds all jobs which contain the substring "Warehouse::OrderShip"
367
- and deletes all matching retries. If the set is large, this API
368
- will be **MUCH** faster than standard iteration using each.
369
- **Redis 2.8**
370
- ```ruby
371
- Sidekiq::RetrySet.new.scan("Warehouse::OrderShip") do |job|
372
- job.delete
373
- end
374
- ```
375
-
376
- - Sidekiq::Batch#jobs now returns the set of JIDs added to the batch.
377
- - Sidekiq::Batch#jids returns the complete set of JIDs associated with the batch.
378
- - Sidekiq::Batch#remove\_jobs(jid, jid, ...) removes JIDs from the set, allowing early termination of jobs if they become irrelevant according to application logic.
379
- - Sidekiq::Batch#include?(jid) allows jobs to check if they are still
380
- relevant to a Batch and exit early if not.
381
- - Sidekiq::SortedSet#find\_job(jid) now uses server-side Lua if possible **Redis 2.6** [jonhyman]
382
- - The statsd integration now sets global job counts:
383
- ```ruby
384
- jobs.count
385
- jobs.success
386
- jobs.failure
387
- ```
388
-
389
- - Change shutdown logic to push leftover jobs in the private queue back
390
- into the public queue when shutting down with Reliable Fetch. This
391
- allows the safe decommission of a Sidekiq Pro process when autoscaling. [jonhyman]
392
- - Add support for weighted random fetching with Reliable Fetch [jonhyman]
393
- - Pro now requires Sidekiq 2.17.0
394
-
395
- 1.2.5
396
- -----------
397
-
398
- - Convert Batch UI to use Sidekiq 2.16's support for extension localization.
399
- - Update reliable\_push to work with Sidekiq::Client refactoring in 2.16
400
- - Pro now requires Sidekiq 2.16.0
401
-
402
- 1.2.4
403
- -----------
404
-
405
- - Convert Batch UI to Bootstrap 3
406
- - Pro now requires Sidekiq 2.15.0
407
- - Add Sidekiq::Batch::Status#delete [#1205]
408
-
409
- 1.2.3
410
- -----------
411
-
412
- - Pro now requires Sidekiq 2.14.0
413
- - Fix bad exception handling in batch callbacks [#1134]
414
- - Convert Batch UI to ERB
415
-
416
- 1.2.2
417
- -----------
418
-
419
- - Problem with reliable fetch which could lead to lost jobs when Sidekiq
420
- is shut down normally. Thanks to MikaelAmborn for the report. [#1109]
421
-
422
- 1.2.1
423
- -----------
424
-
425
- - Forgot to push paging code necessary for `delete_job` performance.
426
-
427
- 1.2.0
428
- -----------
429
-
430
- - **LEAK** Fix batch key which didn't expire in Redis. Keys match
431
- /b-[a-f0-9]{16}-pending/, e.g. "b-4f55163ddba10aa0-pending" [#1057]
432
- - **Reliable fetch now supports multiple queues**, using the algorithm spec'd
433
- by @jackrg [#1102]
434
- - Fix issue with reliable\_push where it didn't return the JID for a pushed
435
- job when sending previously cached jobs to Redis.
436
- - Add fast Sidekiq::Queue#delete\_job(jid) API which leverages Lua so job lookup is
437
- 100% server-side. Benchmark vs Sidekiq's Job#delete API. **Redis 2.6**
438
-
439
- ```
440
- Sidekiq Pro API
441
- 0.030000 0.020000 0.050000 ( 1.640659)
442
- Sidekiq API
443
- 17.250000 2.220000 19.470000 ( 22.193300)
444
- ```
445
-
446
- - Add fast Sidekiq::Queue#delete\_by\_class(klass) API to remove all
447
- jobs of a given type. Uses server-side Lua for performance. **Redis 2.6**
448
-
449
- 1.1.0
450
- -----------
451
-
452
- - New `sidekiq/pro/reliable_push` which makes Sidekiq::Client resiliant
453
- to Redis network failures. [#793]
454
- - Move `sidekiq/reliable_fetch` to `sidekiq/pro/reliable_fetch`
455
-
456
-
457
- 1.0.0
458
- -----------
459
-
460
- - Sidekiq Pro changelog moved to mperham/sidekiq for public visibility.
461
- - Add new Rack endpoint for easy polling of batch status via JavaScript. See `sidekiq/rack/batch_status`
462
-
463
- 0.9.3
464
- -----------
465
-
466
- - Fix bad /batches path in Web UI
467
- - Fix Sinatra conflict with sidekiq-failures
468
-
469
- 0.9.2
470
- -----------
471
-
472
- - Fix issue with lifecycle notifications not firing.
473
-
474
- 0.9.1
475
- -----------
476
-
477
- - Update due to Sidekiq API changes.
478
-
479
- 0.9.0
480
- -----------
481
-
482
- - Rearchitect Sidekiq's Fetch code to support different fetch
483
- strategies. Add a ReliableFetch strategy which works with Redis'
484
- RPOPLPUSH to ensure we don't lose messages, even when the Sidekiq
485
- process crashes unexpectedly. [mperham/sidekiq#607]
486
-
487
- 0.8.2
488
- -----------
489
-
490
- - Reimplement existing notifications using batch on_complete events.
491
-
492
- 0.8.1
493
- -----------
494
-
495
- - Rejigger batch callback notifications.
496
-
497
-
498
- 0.8.0
499
- -----------
500
-
501
- - Add new Batch 'callback' notification support, for in-process
502
- notification.
503
- - Symbolize option keys passed to Pony [mperham/sidekiq#603]
504
- - Batch no longer requires the Web UI since Web UI usage is optional.
505
- You must require is manually in your Web process:
506
-
507
- ```ruby
508
- require 'sidekiq/web'
509
- require 'sidekiq/batch/web'
510
- mount Sidekiq::Web => '/sidekiq'
511
- ```
512
-
513
-
514
- 0.7.1
515
- -----------
516
-
517
- - Worker instances can access the associated jid and bid via simple
518
- accessors.
519
- - Batches can now be modified while being processed so, e.g. a batch
520
- job can add additional jobs to its own batch.
521
-
522
- ```ruby
523
- def perform(...)
524
- batch = Sidekiq::Batch.new(bid) # instantiate batch associated with this job
525
- batch.jobs do
526
- SomeWorker.perform_async # add another job
527
- end
528
- end
529
- ```
530
-
531
- - Save error backtraces in batch's failure info for display in Web UI.
532
- - Clean up email notification a bit.
533
-
534
-
535
- 0.7.0
536
- -----------
537
-
538
- - Add optional batch description
539
- - Mutable batches. Batches can now be modified to add additional jobs
540
- at runtime. Example would be a batch job which needs to create more
541
- jobs based on the data it is processing.
542
-
543
- ```ruby
544
- batch = Sidekiq::Batch.new(bid)
545
- batch.jobs do
546
- # define more jobs here
547
- end
548
- ```
549
- - Fix issues with symbols vs strings in option hashes
550
-
551
-
552
- 0.6.1
553
- -----------
554
-
555
- - Webhook notification support
556
-
557
-
558
- 0.6
559
- -----------
560
-
561
- - Redis pubsub
562
- - Email polish
563
-
564
-
565
- 0.5
566
- -----------
567
-
568
- - Batches
569
- - Notifications
570
- - 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,99 +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.kill(0, pid)
45
- rescue Errno::ESRCH
46
- done "Process doesn't exist", :error
47
- # We were not allowed to send a signal, but the process must have existed
48
- # when Process.kill() was called.
49
- rescue Errno::EPERM
50
- return pid
51
- end
52
-
53
- def done(msg, error = nil)
54
- puts msg
55
- exit(exit_signal(error))
56
- end
57
-
58
- def exit_signal(error)
59
- (error == :error) ? 1 : 0
60
- end
61
-
62
- def pid
63
- @pid ||= File.read(pidfile).to_i
64
- end
65
-
66
- def quiet
67
- `kill -USR1 #{pid}`
68
- end
69
-
70
- def stop
71
- `kill -TERM #{pid}`
72
- kill_timeout.times do
73
- begin
74
- Process.kill(0, pid)
75
- rescue Errno::ESRCH
76
- FileUtils.rm_f pidfile
77
- done 'Sidekiq shut down gracefully.'
78
- rescue Errno::EPERM
79
- done 'Not permitted to shut down Sidekiq.'
80
- end
81
- sleep 1
82
- end
83
- `kill -9 #{pid}`
84
- FileUtils.rm_f pidfile
85
- done 'Sidekiq shut down forcefully.'
86
- end
87
- alias_method :shutdown, :stop
88
- end
89
-
90
- if ARGV.length < 2
91
- Sidekiqctl.print_usage
92
- else
93
- stage = ARGV[0]
94
- pidfile = ARGV[1]
95
- timeout = ARGV[2].to_i
96
- timeout = Sidekiqctl::DEFAULT_KILL_TIMEOUT if timeout == 0
97
-
98
- Sidekiqctl.new(stage, pidfile, timeout)
99
- end