Skip to content
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: set wait timeout and update default attempt timeout to 30 minutes #1779

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.15.0')
implementation platform('com.google.cloud:libraries-bom:26.16.0')

implementation 'com.google.cloud:google-cloud-bigtable'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigtable:2.23.1'
implementation 'com.google.cloud:google-cloud-bigtable:2.23.2'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.23.1"
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.23.2"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -609,7 +609,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.23.1
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.23.2
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
.setMaxRetryDelay(Duration.ofMinutes(1))
.setMaxAttempts(10)
.setJittered(true)
.setInitialRpcTimeout(Duration.ofMinutes(5))
.setInitialRpcTimeout(Duration.ofMinutes(30))
.setRpcTimeoutMultiplier(2.0)
.setMaxRpcTimeout(Duration.ofMinutes(5))
.setMaxRpcTimeout(Duration.ofMinutes(30))
.setTotalTimeout(Duration.ofHours(12))
.build();

Expand Down Expand Up @@ -352,17 +352,21 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
*
* <ul>
* <li>{@link ServerStreamingCallSettings.Builder#setIdleTimeout Default idle timeout} is set to
* 5 mins.
* 5 mins. Idle timeout is how long to wait before considering the stream orphaned by the
* user and closing it.
* <li>{@link ServerStreamingCallSettings.Builder#setWaitTimeout Default wait timeout} is set to
* 5 mins. Wait timeout is the maximum amount of time to wait for the next message from the
* server.
* <li>Retry {@link ServerStreamingCallSettings.Builder#setRetryableCodes error codes} are:
* {@link Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}.
* <li>RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay
* starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases
* exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay
* maximum of} 1 minute.
* <li>The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each row} in a
* response stream is 5 minutes with {@link RetrySettings.Builder#setMaxAttempts maximum
* attempt} count of 10 times and the timeout to read the {@link
* RetrySettings.Builder#setTotalTimeout entire stream} is 12 hours.
* <li>The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt}
* is 30 minutes with {@link RetrySettings.Builder#setMaxAttempts maximum attempt} count of
* 10 times and the timeout to read the {@link RetrySettings.Builder#setTotalTimeout entire
* stream} is 12 hours.
* </ul>
*/
public ServerStreamingCallSettings<Query, Row> readRowsSettings() {
Expand Down Expand Up @@ -638,7 +642,8 @@ private Builder() {
readRowsSettings
.setRetryableCodes(READ_ROWS_RETRY_CODES)
.setRetrySettings(READ_ROWS_RETRY_SETTINGS)
.setIdleTimeout(Duration.ofMinutes(5));
.setIdleTimeout(Duration.ofMinutes(5))
.setWaitTimeout(Duration.ofMinutes(5));

// Point reads should use same defaults as streaming reads, but with a shorter timeout
readRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
Expand Down