You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/02/17 06:34:38 UTC

[GitHub] [hadoop] mpryahin commented on a change in pull request #2701: HADOOP-17528. Fix closing an underlying connection pool when closing SFTP File System

mpryahin commented on a change in pull request #2701:
URL: https://github.com/apache/hadoop/pull/2701#discussion_r577357676



##########
File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
##########
@@ -374,4 +374,13 @@ public void testMkDirs() throws IOException {
     assertThat(((SFTPFileSystem) sftpFs).getConnectionPool().getLiveConnCount(),
         is(1));
   }
+
+  @Test
+  public void testCloseFileSystemClosesConnectionPool() throws Exception {
+    SFTPFileSystem fs = (SFTPFileSystem) sftpFs;
+    fs.getHomeDirectory();
+    assertThat(fs.getConnectionPool().getLiveConnCount(), is(1));
+    fs.close();
+    assertThat(fs.getConnectionPool().getLiveConnCount(), is(0));
+  }

Review comment:
       Hey Steve, thanks a lot for reviewing, I appreciate it.
   
   A FileSystem instance already gets closed after each test method, [please take a look over here](https://github.com/apache/hadoop/blob/ca2e5a462daeb48f2e18e6a0ebe2fd6a3f20e89e/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java#L117). I hope this makes the case you pointed out covered. Please, let me know if it doesn't, I will add an extra call to make it look more explicit.




----------------------------------------------------------------
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.

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



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