-
Notifications
You must be signed in to change notification settings - Fork 345
Prevent server crash by restarting child #727
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
Prevent server crash by restarting child #727
Conversation
This is a solution, or maybe better characterized as a work-around, for #716 Before this change, in a Rails
I have put the spring server logs for both the error and fixed versions here: https://gist.github.com/prognostikos/0d07e599516e51ddc355134e13c94a95 I would love to get this into a new Spring release, what needs to be done for that to happen? I can see there are some issues with CI, and running the acceptance tests locally with RAILS_VERSION="edge" also seems to hang so there is probably a bit of work to do on the test setup. |
@@ -42,7 +42,7 @@ def with_child | |||
if alive? | |||
begin | |||
yield | |||
rescue Errno::ECONNRESET, Errno::EPIPE | |||
rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do some kind of cleanup here in case the child is hanging around as a zombie process?
This seems to fix the problems I encountered in #716 👍 |
Could this get attention from the Maintainers ? It's a very simple patch that solves a very annoying problem |
Before this change, if Errno::EINVAL is thrown when sending IO to the child the server would crash. Now we catch the exception and, assuming the child has problems, we start a new child.
dca14de
to
8848593
Compare
Thanks for the fix, @prognostikos ❤️ And cheers for the merge, @rafaelfranca! I would love to see a release with this 🙏 |
Before this change, if Errno::EINVAL is thrown when sending IO to the child the server would crash. Now we catch the exception and, assuming the child has problems, we start a new child.