rdblue commented on code in PR #7513:
URL: https://github.com/apache/iceberg/pull/7513#discussion_r1183871961
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -393,4 +399,19 @@ public void close() {
}
}
}
+
+ @SuppressWarnings("checkstyle:NoFinalizer")
+ @Override
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (!isResourceClosed.get()) {
+ if (null == createStack) {
+ close();
+ } else {
+ String trace =
+ Joiner.on("\n\t").join(Arrays.copyOfRange(createStack, 1,
createStack.length));
+ LOG.warn("Unclosed S3FileIO instance created by:\n\t{}", trace);
Review Comment:
Yes, we want this to be a warning so that people report it and we fix leaks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]