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
application exceptions raised from the Listen.to callback will break listening in the process #505
Comments
We found this bug while testing v3.3.0.pre.2 in production. I want to fix it before releasing generally. @ioquatix Any opinion on the rescue question? I'm leaning towards |
If anyone's curious about the |
You should almost never do If the user code raises an exception, I don't see why that should not cause the event loop to exit. Think about a user pressing How about if the exception is silently consumed? User never knows there is problem. |
Yes, I'm aware of that rule of thumb. It's fairly common to need to break that rule, though, and this feels like it might be such a case.
It just happened to us in production while using
I just checked and process exceptions like that get delivered to the main thread. Other threads (like this listen one) won't see those process exceptions.
The exception is logged in both the old and new code. What's addressed in this issue is the problem of tearing down the |
Fix merged and released in v3.3.0. |
Current State
When the listen
processor
calls back into the application's callback block, if any exception gets raised from that block, it will tear down the processor thread andlisten
will stop working in that process.Desired State
Any exception raised from the application should be rescued and logged by the processor thread, but it should keep running; the exception should not tear down the thread.
Steps to Reproduce
Design Questions
Exception
orStandardError
? Typically it's recommended to just rescueStandardError
. But that is probably too limiting here, isn't it? Consider for example a Ruby typo that raises aScriptError
for example.The text was updated successfully, but these errors were encountered: