File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,23 @@ static void executeSqlWithCustomTimeoutAndRetrySettings(
5353
.setRetrySettings(
5454
RetrySettings.newBuilder()
5555
// Configure retry delay settings.
56+
// The initial amount of time to wait before retrying the request.
5657
.setInitialRetryDelay(Duration.ofMillis(500))
58+
// The maximum amount of time to wait before retrying. I.e. after this value is
59+
// reached, the wait time will not increase further by the multiplier.
5760
.setMaxRetryDelay(Duration.ofSeconds(64))
61+
// The previous wait time is multiplied by this multiplier to come up with the next
62+
// wait time, until the max is reached.
5863
.setRetryDelayMultiplier(1.5)
5964

6065
// Configure RPC and total timeout settings.
66+
// Timeout for the first RPC call. Subsequent retries will be based off this value.
6167
.setInitialRpcTimeout(Duration.ofSeconds(60))
68+
// The max for the per RPC timeout.
6269
.setMaxRpcTimeout(Duration.ofSeconds(60))
70+
// Controls the change of timeout for each retry.
6371
.setRpcTimeoutMultiplier(1.0)
72+
// The timeout for all calls (first call + all retries).
6473
.setTotalTimeout(Duration.ofSeconds(60))
6574
.build());
6675
// Create a Spanner client using the custom retry and timeout settings.

0 commit comments

Comments
 (0)