You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rdblue (via GitHub)" <gi...@apache.org> on 2023/05/03 15:44:09 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #7513: AWS: Add finalizer to S3FileIO

rdblue commented on code in PR #7513:
URL: https://github.com/apache/iceberg/pull/7513#discussion_r1183871334


##########
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();

Review Comment:
   This should call close either way, outside of the null check for `createStack`. The only behavior difference should be to only print the warning if the stack trace is present.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org