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

J. Baier edited comment on VFS-618 at 8/11/16 8:34 AM:
-------------------------------------------------------

Actually this might happen on two locations. The one I stated in my previous 
comment and in addition to that here (stack trace is based on VFS 2.0):
{quote}
org.apache.commons.vfs2.FileSystemException: Could not read from 
"sftp://user:***@192.168.0.1/folder/file"; because it is a not a file.
        at 
org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetInputStream(SftpFileObject.java:502)
        at 
org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1307)
        at 
org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:396)
{quote}
In VFS 2.1, the code probably fixing the problem above is in line 617 of 
SftpFileObject.doGetInputStream() in the finally block, but this code is 
commented out.


was (Author: johnm):
Actually this might happen on two locations. The one I stated in my previous 
comment and in addition to that here (stack trace is based on VFS 2.0):
{quote}
org.apache.commons.vfs2.FileSystemException: Could not read from 
"sftp://user:***@192.168.0.1/folder/file"; because it is a not a file.
        at 
org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetInputStream(SftpFileObject.java:502)
        at 
org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1307)
        at 
org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:396)
        at com.mitxp.tools.filehandler.FileSystemsWatchDir.a(Unknown Source)
        at com.mitxp.tools.filehandler.WatchDir.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:745)
{quote}
In VFS 2.1, the code probably fixing the problem above is in line 617 of 
SftpFileObject.doGetInputStream() in the finally block, but this code is 
commented out.

> sftp consumes channels on each cd when directory does not exist
> ---------------------------------------------------------------
>
>                 Key: VFS-618
>                 URL: https://issues.apache.org/jira/browse/VFS-618
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: all platforms
>            Reporter: J. Baier
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> While resolving a FileObject on an sftp target for a directory that does not 
> exist on the target, SftpFileSystem.getChannel() is called and while trying 
> to cd to the workingDirectory, an SftpException is thrown but the channel 
> object is not released.
> This leads to many sftp channels kept opoen on the target system and consumes 
> unnecessary resources.
> A simple patch of releasing the channel in the caught SftpException in 
> SftpFileSystem line 125 would solve this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to