-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Sidekiq worker crashes when Twitter library throws an exception, even if exception is rescued #2092
Comments
Can you share your actual worker code? If your worker is streaming, how long does it block for? |
No, there's no streaming. I've contrived a very simple test case. You'll need to supply valid key/secret/token/token_secret values if you want to actually run it, but that's all you should need. This is using revision 6ad7fe327e61ea7dfddf4ef200c7bd7df9aff0ee of sferik/twitter.
Run from console:
Output:
It also intermittently produces this different error output:
|
Any chance you can try the latest twitter gem version? Looks like you're running on an older version. raise_error.rb looks suspicious but doesn't exist in the latest version. |
I have some dependencies that make this difficult, but if that's the only way to get around this problem, I can go that route. But I'd rather figure out this problem, because I can't ensure that it won't happen in other libraries. If it's a matter of just wanting to see the source for that revision, you can do this:
|
Can you run Sidekiq master? It's got a fix for errors which have no On Wed, Dec 17, 2014 at 3:39 PM, scottmartinnet notifications@github.com
|
I experience the same crash under Sidekiq master. |
I'm at a loss to explain then. Can you reproduce the problem in a Ruby snippet so I can experiment? |
What do you need beyond the above TestWorker code? |
I can't run that code because I don't have a twitter dev account. |
I've sent you some testing credentials via email. |
Works fine for me, I need a reproducible scenario:
|
I upgraded the Twitter library to the latest version as you suggested earlier and the crash is no longer happening. It seems this is hard enough to reproduce that I won't be very likely to encounter it again. That's good enough for me. Were you using the Twitter library revision I specified instead of their master? That's the only thing I can think of that could be substantially different between our setups. |
Yes, I was using that ref. Glad it seems to be fixed now. On Thu, Dec 18, 2014 at 11:17 AM, scottmartinnet notifications@github.com
|
I'm experiencing a strange issue with the sidekiq workers. A task I want to run from within Sidekiq uses the standard Twitter library (https://github.com/sferik/twitter) to make a call to the Twitter API which may throw an exception, and I have code in place to rescue that exception and ignore it. But whether or not the exception is rescued, the worker crashes.
I've cut out anything non-essential, and can still reproduce the crash. The code the worker is running looks like this:
And when I run it, I can verify that the "caught" output occurs, and the job should finish normally. But instead, I get a stack trace of the rescued exception and a crashed worker.
Here's a log of the execution:
Research has revealed a few possible approaches, which I've investigated: I've verified that nothing is extending Exception. #1896 appears to describe a very similar problem, but I am catching the exception. Exceptions that do not originate in this Twitter library do not exhibit this behavior. I'm running sidekiq 3.3.0 with sidekiq-pro 1.9.1 and celluloid 0.16.0.
The text was updated successfully, but these errors were encountered: