Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: allow retry on connection establishing exceptions (#1666)
  • Loading branch information
anthavio committed Oct 21, 2021
1 parent 66878c3 commit fd06ad2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
Expand Up @@ -270,7 +270,7 @@ public com.google.api.services.bigquery.model.Dataset call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -298,7 +298,7 @@ public com.google.api.services.bigquery.model.Table call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -326,7 +326,7 @@ public com.google.api.services.bigquery.model.Routine call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -375,7 +375,7 @@ public com.google.api.services.bigquery.model.Job call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -426,7 +426,7 @@ public com.google.api.services.bigquery.model.Dataset call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
if (getOptions().getThrowNotFound() && answer == null) {
throw new BigQueryException(HTTP_NOT_FOUND, "Dataset not found");
Expand Down Expand Up @@ -501,7 +501,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -532,7 +532,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -558,7 +558,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -584,7 +584,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -608,7 +608,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -631,7 +631,7 @@ public com.google.api.services.bigquery.model.Dataset call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -659,7 +659,7 @@ public com.google.api.services.bigquery.model.Table call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -687,7 +687,7 @@ public com.google.api.services.bigquery.model.Model call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -715,7 +715,7 @@ public com.google.api.services.bigquery.model.Routine call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -751,7 +751,7 @@ public com.google.api.services.bigquery.model.Table call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
if (getOptions().getThrowNotFound() && answer == null) {
throw new BigQueryException(HTTP_NOT_FOUND, "Table not found");
Expand Down Expand Up @@ -789,7 +789,7 @@ public com.google.api.services.bigquery.model.Model call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
if (getOptions().getThrowNotFound() && answer == null) {
throw new BigQueryException(HTTP_NOT_FOUND, "Model not found");
Expand Down Expand Up @@ -827,7 +827,7 @@ public com.google.api.services.bigquery.model.Routine call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
if (getOptions().getThrowNotFound() && answer == null) {
throw new BigQueryException(HTTP_NOT_FOUND, "Routine not found");
Expand Down Expand Up @@ -916,7 +916,7 @@ private static Page<Table> listTables(
}
},
serviceOptions.getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
serviceOptions.getClock());
String cursor = result.x();
Iterable<Table> tables =
Expand Down Expand Up @@ -953,7 +953,7 @@ private static Page<Model> listModels(
}
},
serviceOptions.getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
serviceOptions.getClock());
String cursor = result.x();
Iterable<Model> models =
Expand Down Expand Up @@ -990,7 +990,7 @@ private static Page<Routine> listRoutines(
}
},
serviceOptions.getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
serviceOptions.getClock());
String cursor = result.x();
Iterable<Routine> routines =
Expand Down Expand Up @@ -1055,7 +1055,7 @@ public TableDataInsertAllResponse call() throws Exception {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -1119,7 +1119,7 @@ public TableDataList call() {
}
},
serviceOptions.getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
serviceOptions.getClock());
String cursor = result.getPageToken();
Map<BigQueryRpc.Option, ?> pageOptionMap =
Expand Down Expand Up @@ -1179,7 +1179,7 @@ public com.google.api.services.bigquery.model.Job call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
if (getOptions().getThrowNotFound() && answer == null) {
throw new BigQueryException(HTTP_NOT_FOUND, "Job not found");
Expand Down Expand Up @@ -1208,7 +1208,7 @@ public Tuple<String, Iterable<com.google.api.services.bigquery.model.Job>> call(
}
},
serviceOptions.getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
serviceOptions.getClock());
String cursor = result.x();
Iterable<Job> jobs =
Expand Down Expand Up @@ -1247,7 +1247,7 @@ public Boolean call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down Expand Up @@ -1440,7 +1440,7 @@ public com.google.api.services.bigquery.model.Policy call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -1466,7 +1466,7 @@ public com.google.api.services.bigquery.model.Policy call() {
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock()));
} catch (RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand All @@ -1493,7 +1493,7 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call()
}
},
getOptions().getRetrySettings(),
EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
return response.getPermissions() == null
? ImmutableList.of()
Expand Down
Expand Up @@ -60,7 +60,7 @@ public com.google.api.services.bigquery.model.Job call() {
}
},
getOptions().getRetrySettings(),
BigQueryImpl.EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
getOptions().getClock());
job = jobPb != null ? Job.fromPb(getOptions().getService(), jobPb) : null;
} catch (RetryHelper.RetryHelperException e) {
Expand Down Expand Up @@ -91,7 +91,7 @@ public String call() {
}
},
options.getRetrySettings(),
BigQueryImpl.EXCEPTION_HANDLER,
BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER,
options.getClock());
} catch (RetryHelper.RetryHelperException e) {
throw BigQueryException.translateAndThrow(e);
Expand Down

0 comments on commit fd06ad2

Please sign in to comment.