Document closing behavior when using http1x #146
Merged
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.
Because reads are blocking and, by definition, a stream will remain open until either server or client closes them, we don't seem to have a good mechanism to ensure no bytes are left unread from the HTTP response body when the client decides to terminate the stream. On the other hand, this issue only seems to affect HTTP/1.x connections.
I've validated that the go driver prefers HTTP/2.x in prod so, I'm inclined to document this behaviour in case anyone is using it behind an HTTP/1.x proxy instead of trying some complex/unreliable mechanism to ensure clean connection termination at this point.