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

conformance: client sometimes reports incorrect error code for canceled/deadline-exceeded conditions #745

Closed
jhump opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jhump
Copy link
Member

jhump commented May 28, 2024

If an RPC is canceled (by the client or server), the resulting error can sometimes be incorrectly classified, resulting in a *connect.Error with an "unknown" code. The same can happen with timeouts since, under the hood, a timeout will cause the network operation to be canceled.

This mostly happens on connection-related errors, since the net package uses errors other than context.Canceled and context.DeadlineExceeded for cancellations and timeouts (like a canceled or timed-out dial operation or if the server cancels by closing the socket for an HTTP 1.1 connection). The logic needs to be updated to (1) be aware of a larger class of error values returned from the network stack that actually indicate cancelation/timeout conditions and (2) use the operation's context.Context in more places to aid classification (so if we know the context is cancelled or timed out, we can apply the correct code to a larger class of underlying error values).

Some of these cases were also reported in #645.

Found by conformance tests in v1.12.0.

@jhump jhump added the bug Something isn't working label May 28, 2024
@jhump
Copy link
Member Author

jhump commented May 28, 2024

This bug took several changes to find and fix all occurrences. It was fixed by PRs #643, #659, and #709. The last of these fixes was released in v1.16.0.

@jhump jhump closed this as completed May 28, 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
Development

No branches or pull requests

1 participant