[ 
https://issues.apache.org/jira/browse/VFS-619?focusedWorklogId=261060&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-261060
 ]

ASF GitHub Bot logged work on VFS-619:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jun/19 20:23
            Start Date: 16/Jun/19 20:23
    Worklog Time Spent: 10m 
      Work Description: DavidSeptimus commented on pull request #65: VFS-619 
Fixes performance issue with SftpFileObject.getChildren()
URL: https://github.com/apache/commons-vfs/pull/65
 
 
   This PR removes an unnecessary invocation of `SftpObject.getType()` by 
`refresh()`. 
   
   This invocation causes performance degradation of 
`SftpFileObject.getChildren()` when `CacheStrategy.ON_RESOLVE` is in use as 
this forces a call to `refresh()`, which in turn calls `getType()`, making an 
additional `stat()` call to the SFTP server for each child.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 261060)
            Time Spent: 10m
    Remaining Estimate: 0h

> Issue creating HttpClient timeout
> ---------------------------------
>
>                 Key: VFS-619
>                 URL: https://issues.apache.org/jira/browse/VFS-619
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: Ben Xiang
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi,
> Recently we met an issue that the thread got stuck during the http connection 
> using HttpClient. And It showed that the connection timeout was set to 0, 
> which was not what we set. 
> let me briefly show here how we are using VFS2:
> Create a FileSystemOptions with timeout set:
> {code}
> final FileSystemOptions fso = new FileSystemOptions();
> final HttpFileSystemConfigBuilder httpBuilder = 
> HttpFileSystemConfigBuilder.getInstance();
> httpBuilder.setConnectionTimeout(fso, connectionTimeout);
> httpBuilder.setSoTimeout(fso, soTimeout);
> {code}
> Create a FileObject using FileSystemManager:
> {code}
> vfs2FileManager.resolveFile(fileLocation, fso);
> {code}
> Finally get the input stream using DefaultFileContent:
> {code}
> final InputStream instr = fileObject.getInputStream();
> {code}
> We noticed that in executeMethod() of HttpMethodDirector, line 153, it is 
> setting the connection timeout using client's params. However,
> in HttpClientFactory, it's setting fileSystemOptions in connectionMgrParams, 
> and the HttpClient's params would not have this value.
> So we added following 2 lines to make it work:
> In package org.apache.commons.vfs2.provider.http, HttpClientFactory, added 
> line 148 and 149:
> {code}
> client.getParams().setConnectionManagerTimeout(connectionMgrParams.getConnectionTimeout());
> client.getParams().setSoTimeout(connectionMgrParams.getSoTimeout());
> {code}
> Please let me know your thought about this and if there is a patch needed, or 
> is there something we are missing or doing wrong ?
> Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to