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

[pick_first] changes to support dualstack design #34218

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

markdroth
Copy link
Member

@markdroth markdroth commented Aug 31, 2023

This rolls forward only the pick_first changes from #32692, which were rolled back in #33718. Specifically:

  • Changes PF to use its own subchannel list implementation instead of using the subchannel_list library, since the latter will be going away with the dualstack changes.
  • As a result of no longer using the subchannel_list library, PF no longer needs to set the GRPC_ARG_INHIBIT_HEALTH_CHECKING channel arg.
  • Adds an option to start a health watch on the chosen subchannel, to be used in the future when pick_first is the child of a petiole policy. (Currently, this code is not actually called anywhere.)

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Aug 31, 2023
@markdroth markdroth requested a review from eugeneo August 31, 2023 17:50
return;
}
// Ignore any other updates for subchannels we're not currently trying to
// connect to.
if (Index() != subchannel_list()->attempting_index()) return;
if (Index() != subchannel_list_->attempting_index_) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lack of encapsulation for attempting_index_ seems unusual.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what you mean by "encapsulation". If you mean the fact that we're directly accessing a data member, I think it's fine, because this access is coming from SubchannelData, which is nested inside of SubchannelList and can therefore access its data members by normal C++ scoping rules. In effect, SubchannelData is part of the implementation of SubchannelList, so it's fine to access its private data members. We use this pattern quite a bit.

GPR_ASSERT(sc->connectivity_state().has_value());
if (sc->connectivity_state() != GRPC_CHANNEL_TRANSIENT_FAILURE) {
subchannel_list()->set_attempting_index(next_index);
next_index < subchannel_list_->size(); ++next_index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

645-667 seem to use more of subchannel_list_ - so maybe there should be a "find_next_subchannel_not_transient_failure` method in subchannel list class?

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't a method that would ever need to be called from anywhere else, so I don't see any real benefit in moving it to a separate function.

@markdroth markdroth merged commit 6412412 into grpc:master Aug 31, 2023
68 of 69 checks passed
@markdroth markdroth deleted the dualstack_pf_only branch August 31, 2023 21:03
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bloat/none imported Specifies if the PR has been imported to the internal repository lang/core per-call-memory/neutral per-channel-memory/neutral 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.

None yet

2 participants