transport: Fix handling of closed connections in ReadyReader#9031
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9031 +/- ##
==========================================
- Coverage 82.96% 82.91% -0.05%
==========================================
Files 413 413
Lines 33051 33054 +3
==========================================
- Hits 27421 27407 -14
- Misses 4213 4227 +14
- Partials 1417 1420 +3
🚀 New features to boost your workflow:
|
easwars
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
ReadyReaderinterface was added to support non-blocking reads using thesyscallpackage in #8964. While working on follow-up changes to support pooling read buffers in the http2 layer, I noticed test failures where servers were closing the TCP connection, but the client channel remained in the READY state.Root Cause
The unix.Read function doesn't consider the graceful closure of a connection to be an error and instead returns
(0, nil). Since consumers of theio.Readerinterface expect anio.EOFerror in such cases, the translation from(0, nil)to(0, io.EOF)needs to be handled by the reader implementation.RELEASE NOTES: N/A