[ 
https://issues.apache.org/jira/browse/THRIFT-1638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kamil Salas updated THRIFT-1638:
--------------------------------

    Attachment: 0001-thrift-1638.patch

The situation is a bit complicated. There is no way of reconnecting in Java 
socket, but our TSocket supports it. This is not correct for all use cases. 
When a client connects to the server, a Java Socket is created and later 
TSocket(Socket) is called. We should not be able to reconnect this TSocket. 
Once the connection to the client is lost, we can not get it back. 
Unfortunately, the same constructor is also used by TSSLSocketFactory, what 
creates situation when SSL connection over TSocket is not reconnectable. The 
simplest solution would be to disallow reconnection of TSocket, but it is s not 
possible due to mature of the project. 

I propose a workaround which adds a new constructor to the TSocket where we can 
pass a SocketFactory. This creates a way to recreate connection in SSL use 
case. 
I've also added throwing a TTransportException when we want to reconnect 
TSocket which was created by TSocket(Socket). 
                
> TSocket constructor with socket will throw NPE on open
> ------------------------------------------------------
>
>                 Key: THRIFT-1638
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1638
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.8, 0.9, 1.0, 1.1
>            Reporter: Jim Kerwood
>            Priority: Minor
>         Attachments: 0001-thrift-1638.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> When using the constructor of TSocket(Socket s) the open() method will throw 
> an NPE checking host_.length()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to