Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unary response has zero messages due to io.EOF for all io.EOF errors #774

Open
jipperinbham opened this issue Sep 3, 2024 · 3 comments · Fixed by #776
Open

unary response has zero messages due to io.EOF for all io.EOF errors #774

jipperinbham opened this issue Sep 3, 2024 · 3 comments · Fixed by #776
Labels
bug Something isn't working

Comments

@jipperinbham
Copy link

Describe the bug

After updating our dependency from 1.15.0 to 1.16.2, we started to see the error unary response has zero messages returned where we previously used to see io.EOF. #712 appears to have caused the behavioral change to return connect.CodeUnimplemented instead of io.EOF for all cases of io.EOF which can come from general network/transport errors and nothing to do with the gRPC doc linked in the PR. We were relying on io.EOF in a client interceptor to automatically retry requests since we can occasionally see the error due to network flakiness and have since updated to check for the connect.Unimplemented code and error now.

To Reproduce

I couldn't really come up with a great way to provide a reproducible test for this but am happy to do so if it's a blocker.

Environment (please complete the following information):

  • connect-go version or commit: v0.16.2
  • go version: go version go1.23.0 linux/amd64
@jipperinbham jipperinbham added the bug Something isn't working label Sep 3, 2024
@jhump
Copy link
Member

jhump commented Sep 4, 2024

@jipperinbham, this is for unary RPCs using the Connect protocol, right?

@Alfus, pretty sure this is the same issue you encountered and mentioned to me.

We need a way to distinguish when the io.EOF that the framework observes is caused from an actual EOF on the socket (i.e. an unexpected network hangup) vs. when reaching the normal end of the response body. (There are cases in HTTP 1 where it may be impossible to tell, in which case we should assume the former, not the latter.) When the EOF is the former, we should wrap it with an RPC "unavailable" error instead of incorrectly interpreting it as a cardinality violation and replacing it with "unimplemented".

@jipperinbham
Copy link
Author

this is for unary RPCs using the Connect protocol, right?

Correct and sorry I wasn't more explicit with the protocol used.

@jhump
Copy link
Member

jhump commented Sep 17, 2024

My comment in that PR was

So while it doesn't fully resolve #774, it should help a lot.

And yet GitHub decided to auto-close this issue when that PR was merged 😞.

Since it's not fully resolved, I want this issue left open. So re-opening...

@jhump jhump reopened this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants