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

grpc-js: Return LB policy configs from resolvers in JSON form #2538

Merged

Conversation

murgatroid99
Copy link
Member

More generally, the principle here is that LB policy configs should be created and passed around as plain objects until they need to be passed to an LB policy, at which time they are parsed into a typed object.

In addition, an LB policy config for a non-leaf/petiole policy has a list of possible configs for each child policy, and the first usable config in the list is used. Prior to this change, that selection took place at child policy creation time. Now, it takes place at LB policy config parse time, recursively.

The purpose of this PR is to make it easier to implement custom LB policies. Specifically, that spec requires generating arbitrary LB policy configs from Struct messages.

API changes:

  • The interface ServiceConfig and interfaces for its members MethodConfig, LoadBalancingConfig, and RetryPolicy have been moved out of the experimental namespace, into the stable public API.
  • The LoadBalancingConfig type now refers to simple raw objects instead of class instances.
  • experimental.getFirstUsableConfig, experimental.validateLoadBalancingConfig, and experimental.OutlierDetectionLoadBalancingConfig have been removed.
  • experimental.selectLbConfigFromList, experimental.parseLoadBalancingConfig, and experimental.OutlierDetectionRawConfig have been added.

Copy link

@gnossen gnossen left a comment

Choose a reason for hiding this comment

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

TIL the word petiole.

@murgatroid99 murgatroid99 merged commit 4d288de into grpc:master Aug 8, 2023
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants