[
https://issues.apache.org/jira/browse/HADOOP-17528?focusedWorklogId=553166&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-553166
]
ASF GitHub Bot logged work on HADOOP-17528:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 16/Feb/21 19:44
Start Date: 16/Feb/21 19:44
Worklog Time Spent: 10m
Work Description: steveloughran commented on a change in pull request
#2701:
URL: https://github.com/apache/hadoop/pull/2701#discussion_r577089216
##########
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:
can you add another close() here just so we can make sure that
re-entrant close calls are safe.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 553166)
Time Spent: 0.5h (was: 20m)
> Not closing an SFTP File System instance prevents JVM from exiting.
> --------------------------------------------------------------------
>
> Key: HADOOP-17528
> URL: https://issues.apache.org/jira/browse/HADOOP-17528
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 3.2.0
> Reporter: Mikhail Pryakhin
> Assignee: Mikhail Pryakhin
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> SFTP file system leverages a connection pool which is not closed when a file
> system instance gets closed preventing a JVM from exiting as every SFTP
> connection runs in a separate non-daemon thread.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]