Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit c037f17

Browse files
committed
fix: add exceptions throwing to not swallow errors
1 parent e76e70b commit c037f17

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,12 @@ Thread populateArrowBufferedQueue(
844844
if (e.getStatusCode().getCode()
845845
== com.google.api.gax.rpc.StatusCode.Code.NOT_FOUND) {
846846
LOG.warning("Read session expired or not found: %s", e.getMessage());
847+
try {
848+
arrowBatchWrapperBlockingQueue.put(
849+
BigQueryArrowBatchWrapper.ofError(new BigQueryJdbcRuntimeException(e)));
850+
} catch (InterruptedException ie) {
851+
Thread.currentThread().interrupt();
852+
}
847853
break;
848854
}
849855
if (retryCount >= MAX_RETRY_COUNT) {
@@ -881,6 +887,17 @@ Thread populateArrowBufferedQueue(
881887
Thread.currentThread().interrupt();
882888
}
883889
Thread.currentThread().interrupt();
890+
} catch (Exception e) {
891+
LOG.log(
892+
Level.WARNING,
893+
"\n" + Thread.currentThread().getName() + " Error @ arrowStreamProcessor",
894+
e);
895+
try {
896+
arrowBatchWrapperBlockingQueue.put(
897+
BigQueryArrowBatchWrapper.ofError(new BigQueryJdbcRuntimeException(e)));
898+
} catch (InterruptedException ie) {
899+
Thread.currentThread().interrupt();
900+
}
884901
} finally { // logic needed for graceful shutdown
885902
// marking end of stream
886903
try {

0 commit comments

Comments
 (0)