You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/11/10 21:31:00 UTC

[jira] [Commented] (NET-699) FTPClient storeFile() method return false because cannot open socket

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

Gary D. Gregory commented on NET-699:
-------------------------------------

Hello [~loveping0215]

Feel free to provide a PR on GitHub with a unit test.

> FTPClient storeFile() method return false because cannot open socket
> --------------------------------------------------------------------
>
>                 Key: NET-699
>                 URL: https://issues.apache.org/jira/browse/NET-699
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.6
>            Reporter: Gary Chen
>            Priority: Major
>             Fix For: 3.6
>
>         Attachments: image-2021-04-16-14-44-26-858.png
>
>
> Currently we're using common-pool to store those ftpClient, and sometimes the storeFile() method return false with reply "200 send noop successfully".
>  
> {code:java}
> primary:
>   host: nycsdevfeed.rrdev.dev.reuters.com
>   port: 21
>   userName: anonymous
>   password: anonymous
>   role: 0
>   baseDir: /
>   tempFolder: temp/
>   controlEncoding: UTF-8
>   useEPSVWithIPv4: false
>   passiveMode: true
>   dataTimeout: 20000 #ms, transfer command timeout in passive mode
>   connectTimeout: 10000 #ms, socket connection timeout
>   fileType: 2
>   bufferSize: 524288 #512 * 1024
>   controlKeepAliveTimeout: 110  #seconds, keep control command alive, send a NOOP approximately every 5 mins
>   controlKeepAliveReplyTimeout: 45000
>   maxTotal: 5 #max total object in pool, default 8
>   maxIdle: 5 #max idle object in pool, default 8
>   minIdle: 2  #min idle object in pool, default 0
>   testOnCreate: true #verify the validateObject when create object to pool
>   testOnReturn: true #verify the validateObject when return object to pool
>   testOnBorrow: true #verify the validateObject when borrow object to pool
>   testWhileIdle: true #verify the validateObject when evict thread return false(no need to remove idle object)
>   timeBetweenEvictionRunsMillis: 60000 #check the idle object every 60 seconds
>   softMinEvictableIdleTimeMillis: 120000 #keep the minIdle count idle object, remove the redundant idle object
>   numTestsPerEvictionRun: 5 #evict thread will pick up 10 object to verify
>   blockWhenExhausted: true #if there is no more idle object, block the thread until maxWaitMillis
>   maxWaitMillis: -1 #if there is no more idle object, it will throw NoSuchElementException; -1 means always wait
> {code}
> This is the connection poo setting for FtpClient.
>  
> and we found that code in FTPClient._openDataConnection_()
> even the pasv() method return 227, but here still return null, then storeFile() return false with 200 noop reply.
> !image-2021-04-16-14-44-26-858.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)