Skip to content

fix(bigquery-jdbc): expand handling to OOM errors - #14759

Merged
logachev merged 3 commits into
mainfrom
kirl/oom_handling
Oct 28, 2026
Merged

logachev merged 3 commits into
mainfrom
kirl/oom_handling

Conversation

@logachev

Copy link
Copy Markdown
Contributor

Some of errors that can happen during runtime (e.g. OOM) is not an exception, but instead an Error. If that happens, results would be truncated rather than return an error to the user due to finally block handling.

Replacing Exception with Throwable for handling of errors that can happen in the background threads

@logachev
logachev requested review from a team as code owners October 23, 2026 19:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates exception handling across several classes, including BigQueryArrowBatchWrapper, BigQueryBaseResultSet, BigQueryFieldValueListWrapper, and BigQueryStatement, to catch and propagate Throwable instead of Exception, preventing silent stream truncation on background threads during critical failures. It also adds unit tests to verify that OutOfMemoryError is correctly propagated. The review comments provide valuable feedback, pointing out that catching Throwable without rethrowing JVM Errors (like OutOfMemoryError) is an anti-pattern that can leave the JVM in an unstable state, and suggest rethrowing these errors after they are enqueued.

ex);
enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex);
} catch (Exception ex) {
} catch (Throwable ex) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-throw error instance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is running in a background thread, thread will exit after this either way. We mark an error via the queue

@logachev
logachev merged commit 7d4b921 into main Oct 28, 2026
199 checks passed
@logachev
logachev deleted the kirl/oom_handling branch October 28, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants