-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: handle retry info so client respect the delay server sets #2026
Conversation
3a6040c
to
491ae3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please update the pr description with:
- how this was tested e2e
- a link to a rollback doc
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
Show resolved
Hide resolved
...loud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
Outdated
Show resolved
Hide resolved
|
||
// TODO: move this to gax later | ||
@InternalApi | ||
public class ApiException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ApiExceptions. Also please add a private ctor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In gax it is ApiException I think https://github.com/googleapis/sdk-platform-java/blob/main/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiException.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the pattern is that the instance class is singular and the helper utility with static methods is plural.
In this case you are adding latter. Eventually when you upstream, you will make it an instance method and it will be in ApiException. But in the transitional state I think plural makes sense
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java
Show resolved
Hide resolved
|
||
// TODO: move this to gax later | ||
@InternalApi | ||
public class ApiException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the pattern is that the instance class is singular and the helper utility with static methods is plural.
In this case you are adding latter. Eventually when you upstream, you will make it an instance method and it will be in ApiException. But in the transitional state I think plural makes sense
|
||
import com.google.api.core.InternalApi; | ||
|
||
// TODO: move this to gax later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a plan for when we're moving this to gax?
🤖 I have created a release *beep* *boop* --- ## [2.31.0](https://togithub.com/googleapis/java-bigtable/compare/v2.30.0...v2.31.0) (2024-01-12) ### Features * Add a flag to add / remove routing cookie from callable chain ([#2032](https://togithub.com/googleapis/java-bigtable/issues/2032)) ([201e631](https://togithub.com/googleapis/java-bigtable/commit/201e631f893b1edacdd5760c1d180b212dc9e38a)) * Adding feature flags for routing cookie and retry info ([#2031](https://togithub.com/googleapis/java-bigtable/issues/2031)) ([08c5bf1](https://togithub.com/googleapis/java-bigtable/commit/08c5bf1fd76258387135c8c3abe75f13bcdcc1f6)) * Count row merging errors as internal errors ([#2045](https://togithub.com/googleapis/java-bigtable/issues/2045)) ([fc7845b](https://togithub.com/googleapis/java-bigtable/commit/fc7845bd4cefca05bccc4dc3a9f727fd20f5adf6)) * Enable feature flag when setting is enabled ([#2043](https://togithub.com/googleapis/java-bigtable/issues/2043)) ([e0d90db](https://togithub.com/googleapis/java-bigtable/commit/e0d90db67b3ea52d833f7d6bcd78e3f7e91ff301)) * Handle retry info so client respect the delay server sets ([#2026](https://togithub.com/googleapis/java-bigtable/issues/2026)) ([f1b7fc7](https://togithub.com/googleapis/java-bigtable/commit/f1b7fc79ad3fd9006e430e48430331b360bb22e3)) ### Bug Fixes * **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#2044](https://togithub.com/googleapis/java-bigtable/issues/2044)) ([d9042a5](https://togithub.com/googleapis/java-bigtable/commit/d9042a567f284424efb4af69f757883c9781dce3)) * Fix RetryInfo algorithm and tests ([#2041](https://togithub.com/googleapis/java-bigtable/issues/2041)) ([dad7517](https://togithub.com/googleapis/java-bigtable/commit/dad751736112323c578b3c90d9587fc182105747)) ### Dependencies * Update dependency com.google.cloud:gapic-libraries-bom to v1.27.0 ([#2030](https://togithub.com/googleapis/java-bigtable/issues/2030)) ([a492d02](https://togithub.com/googleapis/java-bigtable/commit/a492d02bdc52cb81d8804a4d7cd363b5807bdd47)) * Update dependency com.google.truth.extensions:truth-proto-extension to v1.2.0 ([#2035](https://togithub.com/googleapis/java-bigtable/issues/2035)) ([46e1e03](https://togithub.com/googleapis/java-bigtable/commit/46e1e0335f9969fa1b60acdf17e9b8abbc312ca2)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Creates a new retry algorithm that checks if the throwable has a RetryInfo field, and use the retry_delay in the RetryInfo as the backoff time for the next retry.
Test and rollback plan: https://docs.google.com/document/d/1Kim-80vUSDgYxDVrFtkl8NkV-SsW8KAor_Ca1rpvbyo/edit?resourcekey=0-oV2CmU7_sZEMpPMFF9ZSOA&tab=t.0#bookmark=id.mtpgcav79p4u
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.