Skip to content

Commit 213dddc

Browse files
authored
fix: all throwables should be ignored in shutdown hook (#950)
All throwables (and not just exceptions) should be ignored in the shutdown hook. Failing to close these resources during shutdown is not a major problem, as they will be garbage collected by the backend anyways. Without this wide catch, some applications will log a ClassNotFoundException when shutting down, which can be confusing for end users. Fixes #949
1 parent 3f2933b commit 213dddc

File tree

1 file changed

+1
-1
lines changed
  • google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection

1 file changed

+1
-1
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private final class CloseSpannerRunnable implements Runnable {
104104
public void run() {
105105
try {
106106
checkAndCloseSpanners(CheckAndCloseSpannersMode.WARN);
107-
} catch (Exception e) {
107+
} catch (Throwable e) {
108108
// ignore
109109
}
110110
}

0 commit comments

Comments
 (0)