commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhengweixiong (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-606) Thread hangs when invoke connect method
Date Thu, 05 Jan 2017 12:56:58 GMT

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

zhengweixiong commented on NET-606:
-----------------------------------

Thank you for your reply.
1. It hangs forever when the other connection try in other thread is ok.
2. this is the whole code sample.
setSoTimeout can not be set before connect. I had try it. It can only be called after a connection
has been opened.

    /**
     * Set the timeout in milliseconds of a currently open connection.
     * Only call this method after a connection has been opened
     * by {@link #connect connect()}.
     * <p>
     * @param timeout  The timeout in milliseconds to use for the currently
     *                 open socket connection.
     * @exception SocketException If the operation fails.
     */
    public void setSoTimeout(int timeout) throws SocketException

maybe this is the issue is.

> 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: Minor
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> ftp hangs when trying connect. stack as follows. 
> {noformat}
> "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)
> {noformat}
> this issue happen something when the other times is ok.
> code as follows:
> {code}
> ftps = new FTPSClient("TLSv1.2", true);
> ftps.setConnectTimeout(10000);
> ftps.setDataTimeout(20000);
> ftps.setControlEncoding("UTF-8");
> ftps.connect(ftpServerInfo.getIp());
> ftps.setSoTimeout(20000);
> {code}



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

Mime
View raw message