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

Bernd Eckenfels commented on NET-606:
-------------------------------------

If you know what the issue is, you can add a patch to this bug or sent it to 
the dev@commons Mailing list, we can then make sure it gets applied. You can 
also use Github for a Pull Request if you prefer: 
https://github.com/apache/commons-net/blob/trunk/CONTRIBUTING.md

If you do not know the resoltion it will most likely help to describe the issue 
a bit better. For example providing a Server side error or a Network sniffinf 
trace. Can you also say if this Code hangs forever or only a for a Long time? 
The Code you showed does not correlate with the stacktrace shown, so maybe you 
can help with providing a full example. In your sample Code the setSoTimeout() 
Comes after the ftps.connect(), this might also be a Problem. Anyway, the 
hanging SSL handshake is a sign for a Synchronisation Problem between Client 
and Server (and a possible timeout should resolve it).

> Thread hangs when invoke connect method
> ---------------------------------------
>
>                 Key: NET-606
>                 URL: https://issues.apache.org/jira/browse/NET-606
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>            Reporter: zhengweixiong
>            Priority: Blocker
>              Labels: features
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> ftp hangs when trying connect. stack as follows. 
> "UpdateBrowSerParam" #633 prio=5 os_prio=0 tid=0x00007f60610cc000 nid=0x2165 
> runnable [0x00007f6037403000]
>    java.lang.Thread.State: RUNNABLE
>       at java.net.SocketInputStream.socketRead0(Native Method)
>       at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
>       at java.net.SocketInputStream.read(SocketInputStream.java:170)
>       at java.net.SocketInputStream.read(SocketInputStream.java:141)
>       at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
>       at sun.security.ssl.InputRecord.read(InputRecord.java:503)
>       at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
>       - locked <0x00000006d44fdd70> (a java.lang.Object)
>       at 
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
>       - locked <0x00000006d44fdda0> (a java.lang.Object)
>       at 
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
>       at 
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
>       at 
> org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:263)
>       at 
> org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:192)
>       at org.apache.commons.net.SocketClient.connect(SocketClient.java:164)
>       at org.apache.commons.net.SocketClient.connect(SocketClient.java:184)
>       at 
> com.swimap.prs.utils.ftp.FTPSTransfer.initFTPSClient(FTPSTransfer.java:96)
>       at 
> com.swimap.prs.utils.ftp.FTPSTransfer.initFtpsClient(FTPSTransfer.java:336)
>       at com.swimap.prs.utils.ftp.FTPSTransfer.upload(FTPSTransfer.java:236)
>       at 
> com.swimap.prs.application.paimgr.session.impl.TransferFileService.uploadFile(TransferFileService.java:57)
> this issue happen something when the other times is ok.
> code as follows:
>         ftps = new FTPSClient("TLSv1.2", true);
>         ftps.setConnectTimeout(10000);
>         ftps.setDataTimeout(20000);
>         ftps.setControlEncoding("UTF-8");
>         ftps.connect(ftpServerInfo.getIp());
>         ftps.setSoTimeout(20000);



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

Reply via email to