From 11019b87fe32b5b9c9f2d947ffd9191b56120381 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Tue, 6 Jun 2023 13:52:14 -0400 Subject: [PATCH] fix: set wait timeout and update default attempt timeout to 30 minutes (#1779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .../v2/stub/EnhancedBigtableStubSettings.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 53f02102f..9e1ba6422 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -131,9 +131,9 @@ public class EnhancedBigtableStubSettings extends StubSettings *
  • {@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. + *
  • {@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. *
  • Retry {@link ServerStreamingCallSettings.Builder#setRetryableCodes error codes} are: * {@link Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}. *
  • 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. - *
  • 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. + *
  • 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. * */ public ServerStreamingCallSettings readRowsSettings() { @@ -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();