Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next Release

* Fixed a bug that would crash the server if sending IO to the child failed

## 4.2.1

* Added `Spring.connect_timeout` and `Spring.boot_timeout` to allow to increase timeout for larger apps.
Expand Down
2 changes: 1 addition & 1 deletion lib/spring/application_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def with_child
if alive?
begin
yield
rescue Errno::ECONNRESET, Errno::EPIPE
rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL
Copy link
Author

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?

# The child has died but has not been collected by the wait thread yet,
# so start a new child and try again.
log "child dead; starting"
Expand Down
Loading