Connect unary should return unavailable instead of unimplemented for io.EOF
errors from the transport
#776
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 a test that can reproduce the issue where unary RPCs would return an
unimplemented
code when anunavailable
code was more appropriate. Basically, it was mistakenly interpreting network EOF errors as "the server did not send us any response messages which is cardinality violation" instead of "the server connection broke so the server response is unavailable".There are still cases where an
io.EOF
could likely be misinterpreted as a cardinality issue: if it the connection is severed after the headers have been received but before the first byte of the first envelope has been received. But the main case where this issue has been reported was for unary RPCs in the Connect protocol, which does not suffer from that issue, since it does not use envelopes.So this isn't 100% perfect, but it gets us closer and likely fixes most of the issues in practice. So while it doesn't fully resolve #774, it should help a lot.