Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

feat: deprecate RetrySettings.isJittered [gax-java] #1308

Merged
merged 3 commits into from Feb 19, 2021

Conversation

miraleung
Copy link
Contributor

@miraleung miraleung commented Feb 18, 2021

starts work on #1292

In the future, full deprecation will involve removing the public scoping, since this is still needed to (a) terminate polling for OperationCallableImplTest, and (b) set deterministic values for ExpontentialRetryAlgorithmTest's testCreateNextAttempt and testTruncateToTotalTimeout.

@miraleung miraleung requested review from a team as code owners February 18, 2021 20:39
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 18, 2021
@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #1308 (8573b13) into master (ee370f6) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1308      +/-   ##
============================================
- Coverage     79.51%   79.39%   -0.13%     
+ Complexity     1238     1233       -5     
============================================
  Files           209      209              
  Lines          5434     5397      -37     
  Branches        454      438      -16     
============================================
- Hits           4321     4285      -36     
  Misses          933      933              
+ Partials        180      179       -1     
Impacted Files Coverage Δ Complexity Δ
...ava/com/google/api/gax/retrying/RetrySettings.java 29.78% <ø> (-1.47%) 2.00 <0.00> (ø)
...le/api/gax/retrying/ExponentialRetryAlgorithm.java 96.36% <100.00%> (ø) 14.00 <3.00> (ø)
...n/java/com/google/api/gax/grpc/GrpcStatusCode.java 90.90% <0.00%> (-4.55%) 20.00% <0.00%> (ø%)
...gle/api/gax/httpjson/HttpJsonTransportChannel.java 43.75% <0.00%> (-3.31%) 5.00% <0.00%> (ø%)
.../com/google/api/gax/grpc/GrpcTransportChannel.java 57.14% <0.00%> (-1.95%) 9.00% <0.00%> (ø%)
...m/google/api/gax/batching/FlowControlSettings.java 76.92% <0.00%> (-1.65%) 2.00% <0.00%> (ø%)
...m/google/api/gax/retrying/BasicRetryingFuture.java 92.15% <0.00%> (-0.99%) 25.00% <0.00%> (ø%)
.../java/com/google/longrunning/OperationsClient.java 73.33% <0.00%> (-0.87%) 17.00% <0.00%> (-1.00%)
...m/google/api/gax/httpjson/HttpRequestRunnable.java 59.25% <0.00%> (-0.75%) 8.00% <0.00%> (ø%)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee370f6...b454dce. Read the comment docs.

@@ -112,7 +113,11 @@
* <pre>{@code actualDelay = rand_between(0, min(maxRetryDelay, delay))}</pre>
*
* The default value is {@code true}.
*
* @deprecated Retries will always jitter.
Copy link
Contributor

Choose a reason for hiding this comment

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

will always --> always
per Google tech writing guidelines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -200,7 +205,11 @@ public static Builder newBuilder() {
* <pre>{@code actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))}</pre>
*
* The default value is {@code true}.
*
* @deprecated Retries will always jitter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this true already? I would have expected some updates to concrete methods are also necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we eventually remove the public scoping, then yes. Only ExponentialRetryAlgorithm does anything with this at the moment, but that cannot be changed without removing the test cases mentioned in the PR description.

@@ -200,7 +205,11 @@ public static Builder newBuilder() {
* <pre>{@code actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))}</pre>
Copy link
Contributor

Choose a reason for hiding this comment

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

comment should be updated to specify it's a no-op

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM, though I don't see much harm in keeping the fact of jitter configurable.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

It looks like testTruncateToTotalTimeout should pass even without setting the jitter since it does a relative comparison. testCreateNextAttempt is too strict a test. We should not test exact values of timeouts.

We can fix that later though.

tests are failing, and this needs merge from master.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

I updated the description since I don't think this is a full fix for #1292. It's a good start though.

@miraleung
Copy link
Contributor Author

It looks like testTruncateToTotalTimeout should pass even without setting the jitter since it does a relative comparison. testCreateNextAttempt is too strict a test. We should not test exact values of timeouts.

We can fix that later though.

tests are failing, and this needs merge from master.

Agree that those can be fixed, but OperationCallableImplTest is the real bottleneck - the operations never complete without turning off jitter.

@miraleung
Copy link
Contributor Author

I updated the description since I don't think this is a full fix for #1292. It's a good start though.

Could you please elaborate on what else we need (aside from updating the two tests)?

@miraleung miraleung merged commit 68644a4 into master Feb 19, 2021
@miraleung miraleung deleted the feat/deprecate_isjittered branch February 19, 2021 19:12
@elharo
Copy link
Contributor

elharo commented Feb 19, 2021

The request in #1292 is to always jitter unconditionally. The client should not be able to disable this.

@chingor13
Copy link
Contributor

This was marked as a breaking change - is this intentional? It's going to be releasing a 2.0.0

@elharo elharo changed the title feat!: deprecate RetrySettings.isJittered [gax-java] feat: deprecate RetrySettings.isJittered [gax-java] Feb 25, 2021
@elharo
Copy link
Contributor

elharo commented Feb 25, 2021

No, it shouldn't be. It deprecates but does not remove or change anything.

gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 25, 2021
This should fix the title of the release-please PR. #1308 should not have been marked as breaking

Release-As: 1.62.0
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 25, 2021
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.62.0](https://www.github.com/googleapis/gax-java/compare/v1.61.0...v1.62.0) (2021-02-25)


### Features

* deprecate RetrySettings.isJittered [gax-java] ([#1308](https://www.github.com/googleapis/gax-java/issues/1308)) ([68644a4](https://www.github.com/googleapis/gax-java/commit/68644a4e24f29223f8f533a3d353dff7457d9737))
* dynamic flow control part 1 - add FlowController to Batcher ([#1289](https://www.github.com/googleapis/gax-java/issues/1289)) ([bae5eb6](https://www.github.com/googleapis/gax-java/commit/bae5eb6070e690c26b95e7b908d15300aa54ef1c))


### Bug Fixes

* prevent unchecked warnings in gax-httpjson ([#1306](https://www.github.com/googleapis/gax-java/issues/1306)) ([ee370f6](https://www.github.com/googleapis/gax-java/commit/ee370f62c5d411738a9b25cf4cfc095aa06d9e07))
* remove unused @InternalExtensionOnly from CallContext classes ([#1304](https://www.github.com/googleapis/gax-java/issues/1304)) ([a8d3a2d](https://www.github.com/googleapis/gax-java/commit/a8d3a2dca96efdb1ce154a976c3e0844e3f501d6))


### Dependencies

* update google-auth-library to 0.24.0 ([#1315](https://www.github.com/googleapis/gax-java/issues/1315)) ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
* update google-common-protos to 2.0.1 ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
* update google-http-client to 1.39.0 ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
* update google-iam ([#1313](https://www.github.com/googleapis/gax-java/issues/1313)) ([327b53c](https://www.github.com/googleapis/gax-java/commit/327b53ca7739d9be6e24305b23af2c7a35cb6f4d))
* update gRPC to 1.36.0 ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
* update opencensus to 0.28.0 ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
* update protobuf to 3.15.2 ([772331e](https://www.github.com/googleapis/gax-java/commit/772331eda5c47e9de376e505e7d8ee502b01ec72))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants