core
core copied to clipboard
gRPC apps can make resilient API calls with client retry support
Automatically retrying some failed API calls (i.e. connection failure, transient server error) is a common task in apps. Polly is an OSS library often used to support retries with RESTful APIs. Unfortunately Polly doesn't work with gRPC.
There is a gRPC specification for retrying failed calls - https://github.com/grpc/proposal/blob/master/A6-client-retries.md
The spec is implemented by the two first-class gRPC implementations: grpc-go and grpc-java. It is partially implemented by ccore and its related bindings (C++, PHP, Python, C#). There is currently no retry support in grpc-dotnet.
Reasons to do:
- To maintain feature parity with other first-class gRPC implementations
- Support apps that need retry functionality to be resilient
- First-party customer demand
Dev features/work:
- [x] Add API to get RST_STREAM value from HTTP exceptions - https://github.com/dotnet/runtime/issues/43239
- [x] Add support for retries to gRPC client library - https://github.com/grpc/grpc-dotnet/issues/1189
- [x] gRPC client update to read protocol error from new .NET 6 exceptions - https://github.com/grpc/grpc-dotnet/issues/1241
What epic should this be listed under?
@JamesNK any requirements on the client networking stack here?
What epic should this be listed under?
It was under cloud native. @richlander removed it. What was the reason behind that?
@JamesNK any requirements on the client networking stack here?
Maybe. I will need to do some investigation then talk to client team
OK, please let us know if there are. cc @karelz
@glennc should this be parented somewhere in the Cloud Native Theme?
This is done now, right @JamesNK ?
Done! https://docs.microsoft.com/en-us/aspnet/core/grpc/retries?view=aspnetcore-6.0
A feature wasn't added in HttpClient, which is why some issues aren't closed, but I worked around it.
Bulk closing .NET 6 epics and user stories. If you think this issue was closed in error, please reopen the issue and update it accordingly.