Skip to content

transport: Fix handling of closed connections in ReadyReader#9031

Merged
arjan-bal merged 1 commit into
grpc:masterfrom
arjan-bal:fix-rawconn-eof
Apr 1, 2026
Merged

transport: Fix handling of closed connections in ReadyReader#9031
arjan-bal merged 1 commit into
grpc:masterfrom
arjan-bal:fix-rawconn-eof

Conversation

@arjan-bal

Copy link
Copy Markdown
Contributor

Problem

The ReadyReader interface was added to support non-blocking reads using the syscall package 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 the io.Reader interface expect an io.EOF error in such cases, the translation from (0, nil) to (0, io.EOF) needs to be handled by the reader implementation.

RELEASE NOTES: N/A

@arjan-bal arjan-bal added this to the 1.81 Release milestone Apr 1, 2026
@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.91%. Comparing base (c33aa45) to head (56fe0cb).
⚠️ Report is 1 commits behind head on master.

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     
Files with missing lines Coverage Δ
internal/transport/ready_reader.go 77.14% <100.00%> (+2.14%) ⬆️

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@easwars easwars assigned arjan-bal and unassigned easwars Apr 1, 2026
@arjan-bal arjan-bal merged commit c754bf9 into grpc:master Apr 1, 2026
15 of 16 checks passed
@arjan-bal arjan-bal deleted the fix-rawconn-eof branch April 1, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants