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

Remove rpc error when shut down daemon #22058

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

WeiZhang555
Copy link
Contributor

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

@thaJeztah
Copy link
Member

Thanks! ping @tonistiigi @mlaventure for review 👍

@thaJeztah
Copy link
Member

thaJeztah commented Apr 15, 2016

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)

@thaJeztah thaJeztah added this to the 1.11.1 milestone Apr 15, 2016
@@ -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") &&
Copy link
Member

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)

Copy link
Member

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.

Copy link
Contributor Author

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>
@WeiZhang555
Copy link
Contributor Author

Updated.

@cpuguy83
Copy link
Member

LGTM

1 similar comment
@crosbymichael
Copy link
Contributor

LGTM

@thaJeztah thaJeztah merged commit dadc308 into moby:master Apr 18, 2016
@WeiZhang555 WeiZhang555 deleted the remove-rpc-error branch April 18, 2016 23:37
@mlaventure mlaventure mentioned this pull request Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants