Kevin Yank
bc63d0bea3
Improve code style for exception_caused_by_shutdown?
2014-06-30 12:40:18 +10:00
Kevin Yank
df14b3c616
Climb cause chain to determine if exception is due to Sidekiq::Shutdown.
2014-06-30 12:12:54 +10:00
Kevin Yank
56b55845d8
Prevent exceptions caused by Sidekiq::Shutdown from causing jobs to be retried.
...
Jobs in progress during a Sidekiq shutdown/restart are requeued for immediate execution. They should not also be queued for retry.
This is an attempt at a cleaner fix than that proposed with mperham#1354, also discussed on mperham#897. Because it depends on Exception#cause, this fix will only be effective on Ruby 2.1.0; however, the code will run on earlier Rubies.
2014-06-27 17:35:50 +10:00
Mike Perham
0d7d84ff21
Don't load AR middleware at all unless AR::Base is defined, #1666
2014-04-24 21:37:20 -07:00
Mike Perham
b639f3711c
Oops, that's an instance
2014-04-15 08:53:41 -07:00
Mike Perham
00dada50e1
Add job context to retry_exhausted error, #1655
2014-04-15 08:52:46 -07:00
Mike Perham
024bbfadbf
💩 , forgot to get this into 3.0
2014-03-28 10:15:55 -07:00
Mike Perham
83aea0690e
Explicitly pass Redis associated with this job
...
When pushing a job, the middleware should be able to access the Redis instance associated with that job. Previously, Sidekiq was limited to one global Redis instance. Now that we want to support sharding, we have to explicitly pass the instance in OR hack up APIs with thread local variables. Explicit is better.
2014-03-25 21:38:17 -07:00
Mike Perham
c1c3c349af
Fix retries_exhausted + dead job handling.
...
retries_exhausted should always be called and then the job pushed to the DJQ.
2014-03-23 15:20:52 -07:00
Mike Perham
2e1ffbc82b
Merge branch 'master' into 3-0
2014-02-09 15:09:22 -08:00
Mike Perham
2f4d3686ec
Store timestamps as floats, not strings, fixes #1473
2014-02-09 15:08:21 -08:00
Mike Perham
d355a0475e
Add dead job queue, fixes #1471
2014-02-09 14:56:01 -08:00
Mike Perham
967e0a5eb7
Remove deprecated retries_exhausted support
2014-02-01 21:25:24 -08:00
Mike Perham
4116e2516d
Reset locale to default, fixes #1415
2014-01-01 14:01:50 -08:00
Mike Perham
e087bb3160
Fix client middleware sample
2013-11-14 20:30:11 -08:00
Mike Perham
a42e4960c1
Clean up retries
2013-10-25 22:10:55 -07:00
Mike Perham
e63a9d8863
Add tests for new client instances
2013-10-25 21:07:54 -07:00
Mike Perham
c7c8044d75
Minor refactoring of chain
2013-09-12 14:14:17 -07:00
Mike Perham
2b9ab89489
Ensure we always pass a Hash to handle_exception, fixes #1134
2013-08-25 12:59:33 -07:00
David Czarnecki
3f0d7e32a4
Allow for default number of retry attempts to be set for RetryJobs middleware.
...
* Adds `max_retries` option to RetryJobs middleware. Default is still 25. This
way you can still retry jobs, but not have it spread out over such a long
period.
Modify `Sidekiq::Middleware::Chain#add` semantics
* If middleware class already exists in the chain, remove the
existing class and add it with possibly new arguments.
2013-08-01 16:23:50 -04:00
Mike Perham
c7b0a349ae
Make Chain enumerable
2013-07-27 16:14:07 -07:00
Justin Mazzi
b41fcd2d1e
Pass the entire message to sidekiq_retries_exhausted
2013-06-27 12:22:50 -04:00
Justin Mazzi
f58f6b1947
Add link to Error-Handling wiki page
2013-06-27 11:58:23 -04:00
Justin Mazzi
ba2ec5800e
Deprecate Worker#retries_exhausted in favor of the
...
`sidekiq_retries_exhausted` callback
2013-06-27 11:17:44 -04:00
Justin Mazzi
5200b282ea
Allow retries_exhausted to be defined in a block
...
sidekiq_retries_exhausted { |*args| }
2013-06-26 13:50:19 -04:00
Mike Perham
c76dd42d55
Refactor sidekiq_retry_in impl
2013-06-25 21:10:46 -07:00
Justin Mazzi
2ab552e7cf
Revert "Refactor into a class"
...
This reverts commit 9583f090a8
.
2013-06-25 23:41:36 -04:00
Justin Mazzi
9583f090a8
Refactor into a class
2013-06-25 13:56:37 -04:00
Justin Mazzi
5f4cf06ee5
fixup
2013-06-25 12:37:59 -04:00
Justin Mazzi
da0b94ebb0
Let them know it's being retried using the default
2013-06-25 12:37:29 -04:00
Justin Mazzi
37b4f2ab4f
fixup
2013-06-25 12:36:23 -04:00
Justin Mazzi
8983f4446a
Log retry delay failures and fallback to the default
2013-06-25 12:35:11 -04:00
Justin Mazzi
6d023a61b9
Add custom retry delay
2013-06-25 11:07:45 -04:00
Mike Perham
e753ff9615
Dont save i18n locale if already set, fixes #1011
2013-06-19 08:33:28 -07:00
Mike Perham
06acbd4f60
Avoid calling processor during hard shutdown, fixes #997
2013-06-10 22:20:15 -07:00
Mike Perham
541ff1f58a
Ignore Shutdown exception in retry middleware, fixes #897
2013-05-03 09:50:20 -07:00
Mike Perham
3eb6ad457c
Explicitly test false to avoid warning on Ruby 2.0, fixes #869
2013-04-24 10:53:02 -07:00
Mike Perham
7e094567a5
Remove timeout middleware and worker option, fixes #862
2013-04-18 09:11:49 -07:00
Mike Perham
e7eca11811
I dont think we want to skip retry, #377
2013-03-26 23:00:18 -07:00
Mike Perham
cfae522adf
Raise within any workers which haven't finished within the hard timeout, fixes #377
2013-03-26 22:56:49 -07:00
Mike Perham
879995dd08
actually test exhausted feature
2013-03-21 14:37:41 -07:00
Mike Perham
c62f59e62a
Merge pull request #780 from EasyGive/master
...
Hook to process events after a job fails all retries
2013-03-21 12:51:11 -07:00
James Kassemi
2241e659f6
Documentation update 'exhausted' to 'retries_exhausted'
2013-03-21 13:49:05 -06:00
James Kassemi
5824857b59
'exhausted' changed to 'retries_exhausted'
...
Additionally, any errors raised during retries_exhausted hook
are logged and dropped before resuming original control flow.
2013-03-21 12:16:07 -06:00
lulalala
e649006109
Makes retry time calculation easier to monkey-patch by changing it from
...
a constant proc to a method.
2013-03-20 16:14:10 +08:00
James Kassemi
172434d459
Call 'exhausted' worker method after retries
...
When the maximum number of retries is hit and the message is about
to be thrown away, give the option of allowing the worker to say
goodbye by defining an 'exhausted' method on the worker.
2013-03-18 15:20:28 -06:00
Mike Perham
fe57c7d6dd
Add i18n middleware, fixes #750
2013-03-03 16:20:01 -08:00
Ryan Lower
b199d37efd
Allow specification of retry_queue in sidekiq_options
2013-01-15 17:28:52 -08:00
Jack Royal-Gordon
54da57aef9
Fix issue causing middleware chain corruption when inserting before or after
...
#delete_if returns the chain, not the entry deleted. Changed to use #index followed by #delete_at.
2012-12-24 23:15:23 -08:00
Jack Royal-Gordon
aeb8177c37
Correct bug when deleting existing element from chain
...
Use #delete_if instead of #delete
2012-12-20 12:52:38 -08:00