Skip to content

Use SubchannelInterface to hide implementation from LB policy API#18917

Merged
markdroth merged 1 commit intogrpc:masterfrom
markdroth:subchannel_interface
May 29, 2019
Merged

Use SubchannelInterface to hide implementation from LB policy API#18917
markdroth merged 1 commit intogrpc:masterfrom
markdroth:subchannel_interface

Conversation

@markdroth
Copy link
Copy Markdown
Member

@markdroth markdroth commented Apr 30, 2019

In particular, this hides the health check service name from the LB policy API.


This change is Reviewable

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Apr 30, 2019
@markdroth markdroth force-pushed the subchannel_interface branch 3 times, most recently from 945c3c2 to ea50047 Compare May 10, 2019 18:29
Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 23 files at r1, 17 of 22 files at r2.
Reviewable status: 19 of 20 files reviewed, 2 unresolved discussions (waiting on @apolcyn, @AspirinSJL, and @markdroth)


src/core/ext/filters/client_channel/client_channel.cc, line 996 at r2 (raw file):

 private:
  class WatcherWrapper : public Subchannel::ConnectivityStateWatcher {

Could you describe the relationship between the various kinds of watcher classes a little more? I'm kind of lost here.


src/core/ext/filters/client_channel/client_channel.cc, line 1021 at r2 (raw file):

  Subchannel* subchannel_;
  UniquePtr<char> health_check_service_name_;
  // Maps from the address of the wrapper watcher passed to us to the

The map is actually from ConnectivityStateWatcher to WatcherWrapper?

Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 22 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @apolcyn and @markdroth)

Copy link
Copy Markdown
Member Author

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @apolcyn and @AspirinSJL)


src/core/ext/filters/client_channel/client_channel.cc, line 996 at r2 (raw file):

Previously, AspirinSJL (Juanli Shen) wrote…

Could you describe the relationship between the various kinds of watcher classes a little more? I'm kind of lost here.

I'm glad you asked about this. I was going to add some comments explaining this, but in the process of doing that, I realized that this level of indirection was not actually necessary. I've made some changes to remove the indirection, so the WrapperWatcher class has been removed.


src/core/ext/filters/client_channel/client_channel.cc, line 1021 at r2 (raw file):

Previously, AspirinSJL (Juanli Shen) wrote…

The map is actually from ConnectivityStateWatcher to WatcherWrapper?

You're right, the comment was backwards. But this map has been removed now.

@markdroth
Copy link
Copy Markdown
Member Author

(Actually, it looks like I will need to re-add the wrapper watcher as part of #19042, but if so, I'll deal with that separately.)

Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Reviewed 14 of 14 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @apolcyn and @markdroth)


src/core/ext/filters/client_channel/lb_policy/subchannel_list.h, line 32 at r3 (raw file):

// TODO(roth): Should not need the include of subchannel.h here, since
// that implementation should be hidden from the LB policy API.
#include "src/core/ext/filters/client_channel/subchannel.h"

Why do we add it back then?

Copy link
Copy Markdown
Member Author

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @apolcyn and @AspirinSJL)


src/core/ext/filters/client_channel/lb_policy/subchannel_list.h, line 32 at r3 (raw file):

Previously, AspirinSJL (Juanli Shen) wrote…

Why do we add it back then?

It's needed for the subchannel address channel arg. It was previously being included transitively, because it was included in subchannel_interface.h, but I removed that include, since subchannel.h now needs to include subchannel_interface.h for the ConnectivityStateWatcher definition.

I will clean this up in a later PR.

Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @apolcyn and @markdroth)


src/core/ext/filters/client_channel/lb_policy/subchannel_list.h, line 32 at r3 (raw file):

Previously, markdroth (Mark D. Roth) wrote…

It's needed for the subchannel address channel arg. It was previously being included transitively, because it was included in subchannel_interface.h, but I removed that include, since subchannel.h now needs to include subchannel_interface.h for the ConnectivityStateWatcher definition.

I will clean this up in a later PR.

I see. Thanks for explaining!

@markdroth
Copy link
Copy Markdown
Member Author

I've merged in the changes from #19049 and added a ConnectedSubchannelInterface definition to avoid some build/dependency problems.

@markdroth
Copy link
Copy Markdown
Member Author

Known issues: #18416 #19005 #19176

@markdroth markdroth force-pushed the subchannel_interface branch from 466d1b9 to 28ccd61 Compare May 29, 2019 19:21
Copy link
Copy Markdown
Contributor

@AspirinSJL AspirinSJL left a comment

Choose a reason for hiding this comment

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

Reviewed 18 of 18 files at r4.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @apolcyn and @markdroth)

@markdroth markdroth merged commit d262014 into grpc:master May 29, 2019
@markdroth markdroth deleted the subchannel_interface branch May 29, 2019 22:20
@lock lock bot locked as resolved and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants