Skip to content

grpc/child_manager: use generic child builder - #2851

Merged
arjan-bal merged 7 commits into
grpc:masterfrom
arjan-bal:generic-child-manager
Sep 9, 2026
Merged

grpc/child_manager: use generic child builder#2851
arjan-bal merged 7 commits into
grpc:masterfrom
arjan-bal:generic-child-manager

Conversation

@arjan-bal

@arjan-bal arjan-bal commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Contributes to: #2761

Make ChildManager generic over the LbPolicyBuilder type it manages.

Previously, type checking for LB policies and their configuration types relied on runtime invariants enforced by DynAdapter. Parameterizing ChildManager provides compile-time guarantees for these types.

As a result:

  • RoundRobin now manages concrete, non-type-erased PickFirst children.
  • Priority will manage GracefulSwitch children.

Additional Changes

  • Updated RoundRobin tests to use the real PickFirst balancer rather than test stubs.

@dfawley dfawley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After chatting with @LucioFranco, it's probably best to remove the auto_impl usage for now. It seems like people take the proc macro costs pretty seriously, and we also might be able to tweak the way we use serde to avoid it, too... But if we start adopting this crate, then we'll have more work to do if we do want to do that.

@dfawley dfawley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Everything else LGTM, so approving for when that's removed.

@dfawley dfawley assigned arjan-bal and unassigned dfawley Sep 8, 2026
@arjan-bal arjan-bal changed the title grpc/child_manager: Use generic child builder grpc/child_manager: use generic child builder Sep 9, 2026
@arjan-bal
arjan-bal merged commit ddd7509 into grpc:master Sep 9, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants