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

clientconn: return ctx.Err() on getTransport failure if non-nil #841

Closed
wants to merge 1 commit into from

Conversation

heyitsanthony
Copy link
Contributor

Otherwise, closing the client with FailFast=false causes outstanding RPCs to
spin forever.

/cc @gyuho

Otherwise, closing the client with FailFast=false causes outstanding RPCs to
spin forever.
@gyuho
Copy link
Contributor

gyuho commented Aug 18, 2016

Confirmed that this fixes the issue in etcd etcd-io/etcd#6221.

/cc @iamqizhao @menghanl

Thanks!

@@ -506,6 +506,9 @@ func (cc *ClientConn) getTransport(ctx context.Context, opts BalancerGetOptions)
if put != nil {
put()
}
if ctx.Err() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assign to a local?

@iamqizhao
Copy link
Contributor

Thanks for the reporting. This is not the right fix though. Let us take this over. will send the fix shortly.

@iamqizhao
Copy link
Contributor

replaced by #842

@iamqizhao iamqizhao closed this Aug 18, 2016
@xiang90
Copy link
Contributor

xiang90 commented Aug 18, 2016

Thanks for the reporting. This is not the right fix though. Let us take this over. will send the fix shortly.

Can you please be more clear about why this is not the right fix next time? So that other people can understand it better. Thank you.

@iamqizhao
Copy link
Contributor

The root cause is that getTransport does not detect ClientConn has been closed in this case. This PR fixed the symptom for a cancelled rpc instead of the root case. The bug remains if this rpc is not cancelled/timeout with this PR.

@xiang90
Copy link
Contributor

xiang90 commented Aug 18, 2016

Thanks for the explanation.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants