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