Skip to content

[pick_first] changes to support dualstack design#34218

Merged
markdroth merged 2 commits into
grpc:masterfrom
markdroth:dualstack_pf_only
Aug 31, 2023
Merged

[pick_first] changes to support dualstack design#34218
markdroth merged 2 commits into
grpc:masterfrom
markdroth:dualstack_pf_only

Conversation

@markdroth

@markdroth markdroth commented Aug 31, 2023

Copy link
Copy Markdown
Member

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
// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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
@ti-chi-bot ti-chi-bot Bot mentioned this pull request Jul 29, 2025
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.

2 participants