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: Implement retries #2278

Merged
merged 9 commits into from Nov 17, 2022
Merged

Conversation

murgatroid99
Copy link
Member

@murgatroid99 murgatroid99 commented Nov 16, 2022

This implements the actual functionality of gRFC A6: Client Retries. The main changes are:

  • Add the RetryingCall class, which implements the retry functionality.
  • Modify the SubchannelCall class to report what RST_STREAM code ended a stream, if any, and the LoadBalancingCall class to use that information to change what call progress it reports with the status.
  • Add the channel arguments for configuring retries.
  • Modify the ResolvingLoadBalancer to pass the service config to the channel along with the config selector when name resolution completes.
  • Modify the server call class to enable it to send trailers-only responses, which are necessary to trigger configured retries on the client.

The tests mainly just test the basic functionality: that the client can make requests in various configurations, and that when retries or hedging are configured, the client makes the appropriate number of attempts per call.

for (const value of obj.nonFatalStatusCodes) {
if (typeof value === 'number') {
if (!Object.values(Status).includes(value)) {
throw new Error('Invlid method config hedging policy: nonFatalStatusCodes value not in status code range');
Copy link

Choose a reason for hiding this comment

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

Nit: s/Invlid/Invalid/g

It appears in three places in this file.

@murgatroid99 murgatroid99 merged commit 89e132a into grpc:master Nov 17, 2022
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