Skip to content
Permalink
Browse files
fix: allow retry on connection establishing exceptions (#1666)
  • Loading branch information
anthavio committed Oct 21, 2021
1 parent 66878c3 commit fd06ad2728e52eac2e8570b0ba15830ad79470ad
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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");
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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");
@@ -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");
@@ -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");
@@ -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 =
@@ -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 =
@@ -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 =
@@ -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);
@@ -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 =
@@ -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");
@@ -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 =
@@ -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);
@@ -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);
@@ -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);
@@ -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()
@@ -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) {
@@ -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);

0 comments on commit fd06ad2

Please sign in to comment.