[ 
https://issues.apache.org/jira/browse/HADOOP-18476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615532#comment-17615532
 ] 

ASF GitHub Bot commented on HADOOP-18476:
-----------------------------------------

rbalamohan commented on code in PR #4966:
URL: https://github.com/apache/hadoop/pull/4966#discussion_r991893949


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3A.java:
##########
@@ -54,4 +55,13 @@ public String toString() {
     sb.append('}');
     return sb.toString();
   }
+
+  /**
+   * Close the file system; the FileContext API doesn't have an explicit close.
+   */
+  @Override
+  protected void finalize() throws Throwable {

Review Comment:
   Is it because Hadoop still relies on JDK 8? And cleaner is available from 
JDK 9? There are also usages of finalize() in other classes like 
ZlibCompressor. May be we can change all finalize() usages in hadoop when min 
JDK version moves to 9.





> Abfs and S3A FileContext bindings to close wrapped filesystems in finalizer
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-18476
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18476
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure, fs/s3
>    Affects Versions: 3.3.4
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Blocker
>              Labels: pull-request-available
>
> if you use the FileContext APIs to talk to abfs or s3a, it creates a new 
> wrapped FileSystem implementation, and, because there is no close() call, 
> never cleans up.
> proposed: add finalizers for these two classes, which we know create helper 
> threads, especially if plugins are added



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to