-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Remove rpc error when shut down daemon #22058
Conversation
Thanks! ping @tonistiigi @mlaventure for review 👍 |
tentatively adding this to 1.11.1 milestone, but it's just a minor improvement, so it's okay if it's not included (and only if there is going to be a 1.11.1 release) |
@@ -254,6 +256,11 @@ func (r *remote) handleEventStream(events containerd.API_EventsClient) { | |||
for { | |||
e, err := events.Recv() | |||
if err != nil { | |||
if strings.Contains(err.Error(), "transport is closing") && |
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.
I was hoping to find a way to inspect this error without resorting to checking the error string, but it doesn't seem that this is possible with this error, which is a grpc.rpcError
Maybe we can do strings.Contains(err.Error(), transport.ErrConnClosing.Desc)
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.
Actually looks like you can do if grpc.ErrorDesc(err) == transport.ErrConClosing.Desc
... probably.
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.
Yes, I agree, inspect error string is stupid way, this looks better.
At first I thought it is transport.ErrConClosing.Desc
but it's not, it's rpcError
with Description from transport.ErrConClosing
. I was hoping to find some function like IsErrConClosing
but there's not something like this. 😭
RPC connection closing error will be reported every time we shutdown daemon, this error is expected, so we should remove this error to avoid confusion to user. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
03e5821
to
a02ae66
Compare
Updated. |
LGTM |
1 similar comment
LGTM |
Fixes #22010
RPC connection closing error will be reported every time we shutdown
daemon, this error is expected, so we should remove this error to avoid
confusion to user.
Signed-off-by: Zhang Wei zhangwei555@huawei.com