Skip to content

Commit 11019b8

Browse files
authored
fix: set wait timeout and update default attempt timeout to 30 minutes (#1779)
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 #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent f0d820a commit 11019b8

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
131131
.setMaxRetryDelay(Duration.ofMinutes(1))
132132
.setMaxAttempts(10)
133133
.setJittered(true)
134-
.setInitialRpcTimeout(Duration.ofMinutes(5))
134+
.setInitialRpcTimeout(Duration.ofMinutes(30))
135135
.setRpcTimeoutMultiplier(2.0)
136-
.setMaxRpcTimeout(Duration.ofMinutes(5))
136+
.setMaxRpcTimeout(Duration.ofMinutes(30))
137137
.setTotalTimeout(Duration.ofHours(12))
138138
.build();
139139

@@ -352,17 +352,21 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
352352
*
353353
* <ul>
354354
* <li>{@link ServerStreamingCallSettings.Builder#setIdleTimeout Default idle timeout} is set to
355-
* 5 mins.
355+
* 5 mins. Idle timeout is how long to wait before considering the stream orphaned by the
356+
* user and closing it.
357+
* <li>{@link ServerStreamingCallSettings.Builder#setWaitTimeout Default wait timeout} is set to
358+
* 5 mins. Wait timeout is the maximum amount of time to wait for the next message from the
359+
* server.
356360
* <li>Retry {@link ServerStreamingCallSettings.Builder#setRetryableCodes error codes} are:
357361
* {@link Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}.
358362
* <li>RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay
359363
* starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases
360364
* exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay
361365
* maximum of} 1 minute.
362-
* <li>The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each row} in a
363-
* response stream is 5 minutes with {@link RetrySettings.Builder#setMaxAttempts maximum
364-
* attempt} count of 10 times and the timeout to read the {@link
365-
* RetrySettings.Builder#setTotalTimeout entire stream} is 12 hours.
366+
* <li>The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt}
367+
* is 30 minutes with {@link RetrySettings.Builder#setMaxAttempts maximum attempt} count of
368+
* 10 times and the timeout to read the {@link RetrySettings.Builder#setTotalTimeout entire
369+
* stream} is 12 hours.
366370
* </ul>
367371
*/
368372
public ServerStreamingCallSettings<Query, Row> readRowsSettings() {
@@ -638,7 +642,8 @@ private Builder() {
638642
readRowsSettings
639643
.setRetryableCodes(READ_ROWS_RETRY_CODES)
640644
.setRetrySettings(READ_ROWS_RETRY_SETTINGS)
641-
.setIdleTimeout(Duration.ofMinutes(5));
645+
.setIdleTimeout(Duration.ofMinutes(5))
646+
.setWaitTimeout(Duration.ofMinutes(5));
642647

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

0 commit comments

Comments
 (0)