Skip to content
Permalink
Browse files
fix: set default values for streaming retry (#316)
  • Loading branch information
olavloite committed Jul 6, 2020
1 parent 122a997 commit 543373b22336be72b10026fda9f0b55939ab94b4
Showing with 3 additions and 2 deletions.
  1. +3 −2 google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java
@@ -855,8 +855,9 @@ private static ExponentialBackOff newBackOff() {
return new ExponentialBackOff.Builder()
.setMultiplier(STREAMING_RETRY_SETTINGS.getRetryDelayMultiplier())
.setInitialIntervalMillis(
(int) STREAMING_RETRY_SETTINGS.getInitialRetryDelay().toMillis())
.setMaxIntervalMillis((int) STREAMING_RETRY_SETTINGS.getMaxRetryDelay().toMillis())
Math.max(10, (int) STREAMING_RETRY_SETTINGS.getInitialRetryDelay().toMillis()))
.setMaxIntervalMillis(
Math.max(1000, (int) STREAMING_RETRY_SETTINGS.getMaxRetryDelay().toMillis()))
.setMaxElapsedTimeMillis(Integer.MAX_VALUE) // Prevent Backoff.STOP from getting returned.
.build();
}

0 comments on commit 543373b

Please sign in to comment.