Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-18238

Fix reentrancy check in SFTPFileSystem.close()

    XMLWordPrintableJSON

Details

    Description

      @Override
      public void close() throws IOException {
        if (closed.getAndSet(true)) {
          return;
        }
        try {
          super.close();
        } finally {
          if (connectionPool != null) {
            connectionPool.shutdown();
          }
        }
      }
      

      if you execute this method, the fs can not execute the deleteOnExit method because the fs is closed.

      如果手动调用,sftp fs执行close方法关闭连接池,让jvm能正常退出,deleteOnExsist 将因为fs已关闭无法执行成功。如果不关闭,则连接池不会释放,jvm不能退出。

      https://issues.apache.org/jira/browse/HADOOP-17528,这是3.2.0 sftpfilesystem的问题

       

      Translated:

      If it is called manually, sftp fs executes the close method to close the connection pool, so that the jvm can exit normally, deleteOnExist will fail to execute successfully because fs is closed. If it is not closed, the connection pool will not be released and the jvm cannot exit.

       

      Attachments

        Issue Links

          Activity

            People

              groot Ashutosh Gupta
              yiliu yi liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h