Open
Conversation
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
On an end of stream message, if the connection fails during drain but no bytes were read, prefer the error from the envelope. Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
275fc8b to
b5db2ac
Compare
emcfarlane
commented
Mar 12, 2026
| if connErr, ok := asError(err); ok { | ||
| return connErr | ||
| } | ||
| return errorf(CodeInternal, "corrupt response: I/O error after end-stream message: %w", err) |
Contributor
Author
There was a problem hiding this comment.
This reported the following error in the testcase TestClientBidiOverHTTP1/cumsum_error:
internal: corrupt response: I/O error after end-stream message: read tcp 127.0.0.1:61157->127.0.0.1:60942: wsarecv: An existing connection was forcibly closed by the remote host.
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.
This adds support for bidi streaming over HTTP/1 connections. It's an improvement over #796 adding support for full-duplex streams. It makes use of the new ResponseControler.EnableFullDuplex method to enable support. If disabled, this returns an error and we report the same error as previously. If enabled, the bidi connection is now allowed.
To test bidi streams over HTTP/1
memhttpis updated to use a buffered conn. Both sides of thenet.Pipeare stuck writing, and neither can read because the write is synchronous and blocking. With real TCP sockets, the kernel buffers absorb these writes and there's no deadlock. For HTTP/2 we keep the zero buffer behaviour.Closes #872