-
Notifications
You must be signed in to change notification settings - Fork 126
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: retry ExceptionHandler not retrying on IOException #3668
base: main
Are you sure you want to change the base?
Conversation
…le thrown IOExceptions
} | ||
|
||
@Test | ||
public void testCreateJobFailureShouldRetry() { | ||
when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) | ||
public void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have similar testing for the TableDataWriteChannel that validates behavior for retryable IOException cases? That one's potentially more tricky as it is focused more on inline uploads rather than streaming inserts, despite the poorly chosen name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call out. TabelDataWriteChanel retry on SocketException which is not included in our BIGQUERY_EXCEPTION_HANDLER. I've added it to the general default retry behavior which is also used outside of TabelDataWriteChanel. I think this makes sense but we can move it into just have it within TabelDataWriteChanel if you think that is better.
Added retry tests to TableDataWriteChanelTest. PTAL.
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work on such a massive PR
This PR fix an issue where the retry algorithm did not retrying based on the BIGQUERY_EXCEPTION_HANDLER configuration. This is caused by HttpBigQueryRpc translating IOExceptions into BigQueryException does not match the configurations set by BIGQUERY_EXCEPTION_HANDLER. To resolve this, we implement new internal methods (.*SkipExceptionTranslation) in HttpBigQueryRpc which do not translate the IOException. All retryable calls to HttpBigQueryRpc are updated to use these new methods.
In addition,
Fixes b/394167052 ☕️