-
Notifications
You must be signed in to change notification settings - Fork 3.8k
unpacker: don't log when context is canceled #5314
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
Conversation
|
Hi @jseba. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Build succeeded.
|
Why?
This is not true if the cancel occurs during executing The following also doesn't bubble up "context cancelled" error. if diff.Digest != diffIDs[i] {
abort()
return errors.Errorf("wrong diff id calculated on extraction %q", diffIDs[i])
} |
When using the client API, if our process gets a SIGINT, we cancel the context and handle the errors that result from that. However, we're getting this extra log message that shows up in our metrics as an extra error. I would like to be able to handle this error in our process but I'm not seeing a way to do that other than just silencing it. I'm open to any suggestions to implement something that allows the caller to receive this error and decide what to do with it.
Ah, I missed that, thanks for pointing that out. I was definitely thinking this seemed on the fragile side and wasn't sure what machinery and other things I was missing. |
| abort := func() { | ||
| if err := sn.Remove(ctx, key); err != nil { | ||
| log.G(ctx).WithError(err).Errorf("failed to cleanup %q", key) | ||
| if !errdefs.IsCanceled(err) && !errdefs.IsDeadlineExceeded(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsDeadlineExceeded means that there was a timeout when removing snapshot. I'm not sure we should ignore error in this case.
|
It may be more appropriate to change this to |
|
Handled in #7859 |
When using the client pull API,
Client.Pull, I'm noticing that if the context is canceled, for instance, due to a SIGINT, there is a spurious log message "failed to cleanup" with the error "context canceled". This is coming from the unpacker.I'd like to silence this log message if the cleanup fails because of a context canceled or timeout. The three places where this happens will already return a
context.Cancelederror, which bubbles up to the API caller.