Repository navigation
fix(netconn): return from zero-length reads without waiting - #601
Open
anishpentyala wants to merge 3 commits into
Open
anishpentyala wants to merge 3 commits into
anishpentyala wants to merge 3 commits into
Conversation
A zero-length buffer cannot receive message data. Return without reading while preserving known EOF and expired-deadline errors, and keep skipping empty messages for nonempty buffers.
Cover nil and empty buffers on idle and buffered connections, plus deadline reset and empty-message skipping controls.
Check idle and buffered connections with nil and empty buffers while preserving the buffered message remainder.
This branch has not been deployed
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.
A zero-length
NetConn.Readcurrently waits for a WebSocket message on an idle connection, and keeps retrying if a message reader already has data. This returns(0, nil)without reading a message when the caller buffer is empty. Known EOF and expired-deadline errors keep their existing behavior.The retry loop still skips empty WebSocket messages for nonempty caller buffers, preserving #367. Native tests cover nil and empty buffers on idle and buffered connections, confirm buffered bytes remain available, and exercise deadline reset and empty messages. A browser Wasm test covers idle and buffered connections too.
The native regression fails on the base commit in all four cases. The Wasm idle regression also fails on the base; the candidate passes the native race suite and real Chrome/Wasm tests. No API, dependencies, or framing changes.
Validation was on Linux. The full
make testpipeline (including arm64/QEMU, examples, third-party tests and benchmarks), Autobahn, and other operating systems were not run.