New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling activerecord statement invalid exception during sidekiq shutdow... #1354
Conversation
Sidekiq needs to be usable without Rails. You're referencing an ActiveRecord class which breaks that. That said, I'm not sure there is a good answer for this. |
I updated the change to make sure ActiveRecord is not a necessity. |
I really don't want to special case any one class, then someone else will want another class. With Ruby 2.1, we should be able to use Exception#cause generically to solve this problem. |
@mperham We’re wrestling with this as well. Would you welcome a pull request to fix this when Sidekiq is running on Ruby 2.1 (where |
Yes!
|
Digging further, we’re skeptical that the
Nevertheless, we’ll give it a try and see if it helps. |
…e 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.
I am not sure If this is the cleanest way to handle the issue.
Fix #897