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: retry ExceptionHandler not retrying on IOException #3668

Merged
merged 27 commits into from
Mar 12, 2025
Merged

Conversation

PhongChuong
Copy link
Contributor

@PhongChuong PhongChuong commented Feb 10, 2025

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,

  • To preserve existing BigQueryException structure, this PR updates BigQueryRetryHelper.runWithRetries to parse the IOExceptions thrown by the .*SkipExceptionTranslation methods and translate them into BigQueryRetryException. This is needed as the original HttpBigQueryRpc translate IOExceptions into BigQueryException.
  • To preserve return values in the BigQuery interface for special cases such as HTTP_NOT_FOUND, this PR updates BigQueryImpl to checks the error code and return the appropriate BigQueryException.
  • The unit test BigQueryImplTest.testCreateJobFailureShouldRetryExceptionHandlerExceptions verify that BIGQUERY_EXCEPTION_HANDLER exceptions (UnknownHostException & ConnectException) are being retried

Fixes b/394167052 ☕️

…ion translation
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/java-bigquery API. labels Feb 10, 2025
…ion translation
…ion translation
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 10, 2025
…ion translation
…ion translation
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 26, 2025
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Feb 26, 2025
…le thrown IOExceptions
@PhongChuong PhongChuong marked this pull request as ready for review March 6, 2025 16:40
@PhongChuong PhongChuong requested review from a team as code owners March 6, 2025 16:40
Copy link
Contributor

@whuffman36 whuffman36 left a 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

Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more minor callout for delete behavior, but otherwise LGTM.

Also, "SkipExceptionTranslation" may forever be burned into my retinas, but thanks for slogging through this refactor.

@PhongChuong
Copy link
Contributor Author

Thanks for the review. I've comment on the isRetryErrorCodeHttpNotFound check variation for delete job. PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants