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

Updated handling of gRPC Context Cancelled #159

Closed

Conversation

nrjpoddar
Copy link

Signed-off-by: Neeraj Poddar neeraj@aspenmesh.io

Signed-off-by: Neeraj Poddar <neeraj@aspenmesh.io>
@nrjpoddar
Copy link
Author

nrjpoddar commented Jun 17, 2019

This PR #151 was supposed to fix it but I noticed that the logging was still happening on Cancelled contexts as the error checking was incorrect.

@nrjpoddar
Copy link
Author

@bboreham do you mind taking a look?

@bboreham
Copy link
Collaborator

The code looks fine, but given the previous one also looked fine, can we get any more assurance this time?
How did you find out what to do, both times? Can we point to a reference?
Is it feasible to write a test?

@nrjpoddar
Copy link
Author

Haha, totally agree and a valid point.

How did you find out what to do, both times? Can we point to a reference? -> First time I didn't understand correctly what error type was being returned here for context cancellations. After we upgraded ingester in our environment which had my fixes I was still seeing this error:

ingester level=warn ts=2019-06-21T15:54:23.748137807Z caller=grpc_logging.go:54 method=/cortex.Ingester/QueryStream duration=59.418013ms err="rpc error: code = Canceled desc = context canceled" msg="gRPC\n"

From this I derived that the error was a gRPC error type.

Unit test for this might be a bit tricky but I think I can write it with sufficient dependency injection.

@bboreham
Copy link
Collaborator

Having extended the tests to cover cancellation, I believe this PR was incorrect - we need to cover both context.Canceled and grpc/codes.Canceled. I created #180 to replace.

@bboreham bboreham closed this Feb 18, 2020
yeya24 pushed a commit to yeya24/common that referenced this pull request Jun 12, 2024
Signed-off-by: Alex Yu <yu.alex96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants