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(bigquery): Make exponential backoff retry second based #2212

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private void maybeWaitForInflightQuota() {

@VisibleForTesting
static long calculateSleepTimeMilli(long retryCount) {
return Math.min((long) Math.pow(2, retryCount), 60000);
return Math.min((long) Math.pow(2, retryCount) * 1000, 60000);
mina-asham marked this conversation as resolved.
Show resolved Hide resolved
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ public void testStreamNameMismatch() throws Exception {

@Test
public void testExponentialBackoff() throws Exception {
assertThat(ConnectionWorker.calculateSleepTimeMilli(0)).isEqualTo(1);
assertThat(ConnectionWorker.calculateSleepTimeMilli(5)).isEqualTo(32);
assertThat(ConnectionWorker.calculateSleepTimeMilli(0)).isEqualTo(1000);
assertThat(ConnectionWorker.calculateSleepTimeMilli(5)).isEqualTo(32000);
assertThat(ConnectionWorker.calculateSleepTimeMilli(100)).isEqualTo(60000);
}

Expand Down