-
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
Workers crash when processing jobs #115
Comments
Here's another:
|
This looks like you're using mongo mapper here. Is that library thread-safe? |
It looks like the Processor is running out of stack. This could be caused by infinite recursion in your worker. Second stack shows a problem with the manager that I haven't a clue how could happen. @tarcieri might need to swing by and lend us his wisdom. |
Good question about it being thread-safe....I'll reach out to the maintainer to confirm. |
Haven't heard back, but from poking around message boards and event machine gems, it would appear that MongoMapper is not thread-safe. Guess this is a deal-breaker huh? |
Mongoid is working on being Threadsafe it seems: https://github.com/mongoid/mongoid/issues/1291 |
Celluloid runs all methods in fibers, and it looks like you're exceeding the 4k stack size limitations that fibers impose. That's orthogonal to the issue of not using a thread-safe library, which won't work either. A quick fix is to try to run the code outside of a fiber using |
Try using the Ruby mongo driver directly and see if that helps. |
I know this sounds crazy, but you could also run Sidekiq in single-threaded mode with |
It appears that doing one job worked better (it processed many more). Still got the stack error, but after @tarcieri explanation, seems like these jobs in particular aren't the best candidate because it's doing a LOT of crunching that would likely go over the stack size limitation.
|
That's an unfortunate limitation of wrapping all Celluloid async calls in a fiber. :-( |
Hopefully @mperham's old issue for dynamically increasing the Fiber stack size will get some love, although it was filed 2 years ago. :-( |
Try master now. I'm unclear on what happens if an error is raised in Processor#stats but @tarcieri and I will figure it out. |
Yup, that worked for me when running with -c 1. |
I've opened an issue for this on the Celluloid tracker if you'd like to discuss further: |
I haven't solution yet, please follow Issue #327: Stack Level Too Deep |
I have a job that I run during the night for each of our users. I'm attempting to queue the job with Resque and process them with Sidekiq to ease the transition.
Here is the job:
It appears as though it starts to process them and then dies. The rescue worker has always worked.
The text was updated successfully, but these errors were encountered: