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
Problems if worker doesn't have an error listener #47
Comments
Can you clarify the behavior you are seeing? In general, I would expect the process/project using node-resque to crash outright if the error event is not handled. |
Resque will keep that worker around as running and it will never be freed. |
Ahh! I think you are referring to the fact that the process will die, but the There are some hacks that can be done, IE:
|
Perhaps we should add a note about this to the readme. |
The process doesn't die because resque is already using a domain. Here's an example:
I had to put in a temporary solution for catching the error event for now. If that's your ideal permanent solution (which I personally don't feel is very clean), then we should at least document that. |
Oh, you published the readme note before I hit send. :) |
I guess another thing you might want to think about... some perform errors might not be errors in the sense that the process will be all out of whack. It could just be an error from not being able to talk to some API. If we were always dealing with errors that put node in a horrible state, then yea I think the process should be killed, but that's not always the case. |
Ahh! That last example was helpful. Yes, I agree this is broken in some way. I'll look into it. |
The weirdness actually happens in |
Closing in favor of #49 |
If a worker doesn't have an error event listener attached and a worker has an error, things get into a weird state because
doneWorking
is never called. You can see why by looking into node's eventemitter: https://github.com/joyent/node/blob/master/lib/events.js#L74-89The text was updated successfully, but these errors were encountered: