Skip to content

Commit

Permalink
Fix rails#724
Browse files Browse the repository at this point in the history
This fixes an issue where, when the Spring client times out or otherwise
disconnects from the server, that the server crashes with a `Broken pipe
(Errno::EPIPE)` error.
  • Loading branch information
f1sherman committed Aug 2, 2024
1 parent c5987d5 commit 091f5dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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 Server crash when the Client times out or otherwise disconnects

## 4.2.1

* Added `Spring.connect_timeout` and `Spring.boot_timeout` to allow to increase timeout for larger apps.
Expand Down
2 changes: 2 additions & 0 deletions lib/spring/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def serve(client)
end
rescue SocketError => e
raise e unless client.eof?
rescue Errno::EPIPE => e
log "client disconnected with error #{e.message}, ignoring command"
ensure
redirect_output
end
Expand Down

0 comments on commit 091f5dc

Please sign in to comment.