Skip to content

core: only let ManagedChannelImpl convert empty resolution result to error#5803

Merged
zhangkun83 merged 2 commits intogrpc:masterfrom
zhangkun83:issue_5692
May 30, 2019
Merged

core: only let ManagedChannelImpl convert empty resolution result to error#5803
zhangkun83 merged 2 commits intogrpc:masterfrom
zhangkun83:issue_5692

Conversation

@zhangkun83
Copy link
Copy Markdown
Contributor

Previously, AutoConfiguredLoadBalancer was also handling it, but it
doesn't trigger retries. By returning true for
canHandleEmptyAddressListFromNameResolution(),
AutoConfiguredLoadBalancer effectively by-passed the empty-result
handling logic in ManagedChannelImpl, thus resolution retries were
never triggered.

This change requires AutoConfiguredLoadBalancer to stop being a
LoadBalancer, for its tryHandleResolvedAddresses(). It doesn't
cause any trouble because AutoConfiguredLoadBalancer has become
less and less like a LoadBalancer during the service config changes.

Resolves #5692

…error

Previously, AutoConfiguredLoadBalancer was also handling it, but it
doesn't trigger retries.  By returning true for
canHandleEmptyAddressListFromNameResolution(),
AutoConfiguredLoadBalancer effectively by-passed the empty-result
handling logic in ManagedChannelImpl, thus resolution retries were
never triggered.

This change requires AutoConfiguredLoadBalancer to stop being a
LoadBalancer, for its tryHandleResolvedAddresses().  It has been
sliding away from the standard LoadBalancer interface anyway.
@Deprecated
@Override
public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) {
void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why cant this be removed yet?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LoadBalancers still using the old createSubchannel() will still receive subchannel state updates from this path. It will be removed once LoadBalancer#handleSubchannel is removed.

@zhangkun83 zhangkun83 merged commit eff13a9 into grpc:master May 30, 2019
@zhangkun83 zhangkun83 deleted the issue_5692 branch May 30, 2019 16:48
@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 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.

NameResolver refresh not triggered if empty addresses returned

3 participants