Skip to content

Commit baccd73

Browse files
committed
Merge branch 'main' into PR #3867 to update
2 parents c0f28d7 + 031deb0 commit baccd73

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,15 @@ private void processArrowStreamAsync(
10691069
}
10701070

10711071
} catch (Exception e) {
1072-
throw BigQueryException.translateAndThrow(e);
1072+
if (e instanceof InterruptedException || e.getCause() instanceof InterruptedException) {
1073+
// Log silently and let it fall through to 'finally' for cleanup.
1074+
// This is the "graceful shutdown".
1075+
logger.log(
1076+
Level.INFO, "Background thread interrupted (Connection Closed). Stopping.");
1077+
Thread.currentThread().interrupt();
1078+
} else {
1079+
throw BigQueryException.translateAndThrow(e);
1080+
}
10731081
} finally { // logic needed for graceful shutdown
10741082
// marking end of stream
10751083
try {

0 commit comments

Comments
 (0)