-
Notifications
You must be signed in to change notification settings - Fork 130
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
fix: reduce the probability of RESOURCE_EXHAUSTED errors during tests #734
Conversation
Reduces the probability of RESOURCE_EXHAUSTED errors during tests by making the GetOperation method retry errors with this code with an exponential backoff. The GetOperation method is called repeatedly for long-running operations by a polling future. These calls also count towards the max 5 admin requests per second. Fixes #733
callSettings = | ||
callSettings | ||
.toBuilder() | ||
.setRetryableCodes(codes) | ||
.build(); |
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.
callSettings = | |
callSettings | |
.toBuilder() | |
.setRetryableCodes(codes) | |
.build(); | |
callSettings = callSettings.toBuilder().setRetryableCodes(codes).build(); |
ImmutableSet.<StatusCode.Code>builderWithExpectedSize( | ||
callSettings.getRetryableCodes().size() + 1) | ||
.addAll(callSettings.getRetryableCodes()) | ||
.add(StatusCode.Code.RESOURCE_EXHAUSTED) |
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.
It would be preferable if this could be changed in the generated code, but I don't know whether that is possible considering this comes from the generic com.google.longrunning.stub.OperationsStub
.
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.
It seems we would need this only for fixing the tests (correct me if I am wrong). If that is the case, changing production behaviour to fix those might not be the best path forward. Could we inject different behaviour in test only.
On another note, do we still need this change now that the tests seem to be working as expected?
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.
I've updated the PR to only change this behavior if SpannerOptions#setAutoThrottleAdministrativeRequests
has been set. This means that it will only be enabled for (integration) tests.
Codecov Report
@@ Coverage Diff @@
## master #734 +/- ##
============================================
- Coverage 85.15% 85.03% -0.12%
- Complexity 2562 2563 +1
============================================
Files 142 143 +1
Lines 13960 13983 +23
Branches 1331 1335 +4
============================================
+ Hits 11887 11890 +3
- Misses 1513 1532 +19
- Partials 560 561 +1
Continue to review full report at Codecov.
|
…#734) * fix: reduce the probability of RESOURCE_EXHAUSTED errors during tests Reduces the probability of RESOURCE_EXHAUSTED errors during tests by making the GetOperation method retry errors with this code with an exponential backoff. The GetOperation method is called repeatedly for long-running operations by a polling future. These calls also count towards the max 5 admin requests per second. Fixes #733 * fix: use default retry settings * chore: run formatter * fix: only retry RESOURCE_EXHAUSTED when throttling requests
This is an auto-generated regeneration of the .pb.go files by cloud.google.com/go/internal/gapicgen. Once this PR is submitted, genbot will update the corresponding PR to depend on the newer version of go-genproto, and assign reviewers. Whilst this or any regen PR is open in go-genproto, genbot will not create any more regeneration PRs. If all regen PRs are closed, gapicgen will create a new set of regeneration PRs once per night. If you have been assigned to review this PR, please: - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. That will prompt genbot to assign reviewers to the google-cloud-go PR. Corresponding google-cloud-go PR: googleapis/google-cloud-go#5245 Changes: chore: regenerate API index Source-Link: googleapis/googleapis@8d996c9 feat: sync with latest API updates * Refresh documentation * Messages related to terminal point service were removed * The already deprecated available_capacity field was removed * Route information added to UpdateTrip PiperOrigin-RevId: 417686942 Source-Link: googleapis/googleapis@f7cdb41
🤖 I have created a release *beep* *boop* --- ### [2.5.10](googleapis/java-spanner-jdbc@v2.5.9...v2.5.10) (2022-02-09) ### Dependencies * update dependency com.google.cloud:google-cloud-spanner-bom to v6.18.0 ([googleapis#734](googleapis/java-spanner-jdbc#734)) ([52f407a](googleapis/java-spanner-jdbc@52f407a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Reduces the probability of
RESOURCE_EXHAUSTED
errors during tests by making the GetOperation method retry errors with this code with an exponential backoff. The GetOperation method is called repeatedly for long-running operations by a polling future. These calls also count towards the max 5 admin requests per second.Fixes #733