googleapis / googleapis/google-cloud-cpp
RPC timeouts and retry loops across services
- Dominant language
- C++
- Stars
- 659
- Forks
- 462
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 89
Description
The `google::cloud::bigtable::RPCRetryPolicy` classes have special member functions to setup a timeout:
https://github.com/googleapis/google-cloud-cpp/blob/81adbdabca2da794875fd567591fddc2cf0c8394/google/cloud/bigtable/rpc_retry_policy.h#L98-L101
https://github.com/googleapis/google-cloud-cpp/blob/81adbdabca2da794875fd567591fddc2cf0c8394/google/cloud/bigtable/rpc_retry_policy.cc#L53-L57
This is used in the synchronous retry loop, e.g.:
https://github.com/googleapis/google-cloud-cpp/blob/81adbdabca2da794875fd567591fddc2cf0c8394/google/cloud/bigtable/table.cc#L90-L95
But not in the asynchronous retry loop:
https://github.com/googleapis/google-cloud-cpp/blob/81adbdabca2da794875fd567591fddc2cf0c8394/google/cloud/internal/async_retry_unary_rpc.h#L145-L149
That asynchronous retry loop is used in spanner too, and the `RetryPolicy` for spanner does not have a `Setup()` member function. Furthermore, the same retry policy class is used in storage, where we would't want to introduce it (because that would create an unwanted dependency on gRPC).
We need a cleaner way to setup per-RPC timeouts across all services, with good support for REST, and we need to use that on the asynchronous and synchronous loops.
Contributor guide
Research direction
Start with google/cloud/bigtable/rpc_retry_policy.h and .cc, google/cloud/bigtable/table.cc, and google/cloud/internal/async_retry_unary_rpc.h. Compare the synchronous and asynchronous retry loops and the Bigtable and Spanner retry policies, then define what a shared per-RPC timeout mechanism must provide for REST without adding a gRPC dependency to Storage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, grpc
- Domain
- backend-api-design, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100