You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alexey Sviridov (Created) (JIRA)" <ji...@apache.org> on 2012/02/25 16:45:49 UTC

[jira] [Created] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
-------------------------------------------------------------------------------------

                 Key: THRIFT-1523
                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
             Project: Thrift
          Issue Type: Bug
          Components: Java - Library
    Affects Versions: 0.8, 0.7, 0.6.1, 0.9
            Reporter: Alexey Sviridov
            Priority: Blocker


TSSLTransportFactory has method 

   public static TServerSocket getServerSocket(int port, int clientTimeout) 

there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217008#comment-13217008 ] 

Alexey Sviridov edited comment on THRIFT-1523 at 2/27/12 3:03 AM:
------------------------------------------------------------------

patch for solving problem with clientTimeout. Patch for version 0.9 
                
      was (Author: sviridov_alexey):
    patch for solving problem with clientTimeout 
                  
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>         Attachments: clientTimeout.patch
>
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Sviridov updated THRIFT-1523:
------------------------------------

    Comment: was deleted

(was: I'm have a simple patch, but dunno how to attach it here...
so i'm post it right here
{noformat}
== begin of file clientTimeout.patch ===============
--- TSSLTransportFactory-orig.java      2011-11-06 16:40:42.000000000 +0700
+++ TSSLTransportFactory-patched.java   2012-02-25 22:54:12.000000000 +0700
@@ -112,7 +112,7 @@
       if (params != null && params.cipherSuites != null) {
         serverSocket.setEnabledCipherSuites(params.cipherSuites);
       }
-      return new TServerSocket(serverSocket);
+      return new TServerSocket(serverSocket,timeout);
     } catch (Exception e) {
       throw new TTransportException("Could not bind to port " + port, e);
     }

== end of file clientTimeout.patch ===============
{noformat} 
Please, correct me if i'm wrong )
    
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>         Attachments: clientTimeout.patch
>
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216487#comment-13216487 ] 

Alexey Sviridov commented on THRIFT-1523:
-----------------------------------------

After a little explain i'm found method {{createServer(SSLServerSocketFactory factory, int port, int timeout,...}} that creates TServerSocket by {{return new TServerSocket(serverSocket);}} 

this method used timeout parameter with wrong way - by setting {{serverSocket.setSoTimeout(timeout);}} but this is no matter because this timeout setted on server socket and affect only accept() method, and not used for read timeout as desired (btw, later in methos listen() even serverSocket soTimeout setted to 0). For properly handle clientTimeout we need call setSoTimeout on client socket, after we accepted them. This done in method acceptImpl(), but there used internal field clientTimeout_ stored in  constucot of TServerSocket!!! ({{result2.setTimeout(clientTimeout_);}} ) but, as i'm mentioned before, in createServer TServerSocket created by {{new TServerSocket(serverSocket);}} This called constructor {{TServerSocket(serverSocket,0)}} and set internal field clientTimeout_ to 0, what mean wait infinite!

so we only need replace line 
  
  {{return new TServerSocket(serverSocket);}} 
by 
  {{return new TServerSocket(serverSocket,timeout);}} in TSSLTransportFactory.createServer method


                
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Jake Farrell (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-1523.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9
         Assignee: Alexey Sviridov

Committed, thanks for the patch
                
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Assignee: Alexey Sviridov
>            Priority: Blocker
>             Fix For: 0.9
>
>         Attachments: clientTimeout.patch
>
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Sviridov updated THRIFT-1523:
------------------------------------

    Attachment: clientTimeout.patch

patch for solving problem with clientTimeout 
                
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>         Attachments: clientTimeout.patch
>
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216489#comment-13216489 ] 

Alexey Sviridov edited comment on THRIFT-1523 at 2/27/12 2:57 AM:
------------------------------------------------------------------

I'm have a simple patch, but dunno how to attach it here...
so i'm post it right here
{noformat}
== begin of file clientTimeout.patch ===============
--- TSSLTransportFactory-orig.java      2011-11-06 16:40:42.000000000 +0700
+++ TSSLTransportFactory-patched.java   2012-02-25 22:54:12.000000000 +0700
@@ -112,7 +112,7 @@
       if (params != null && params.cipherSuites != null) {
         serverSocket.setEnabledCipherSuites(params.cipherSuites);
       }
-      return new TServerSocket(serverSocket);
+      return new TServerSocket(serverSocket,timeout);
     } catch (Exception e) {
       throw new TTransportException("Could not bind to port " + port, e);
     }

== end of file clientTimeout.patch ===============
{noformat} 
Please, correct me if i'm wrong 
                
      was (Author: sviridov_alexey):
    I'm have a simple patch, but dunno how to attach it here...
so i'm post it right here
{noformat}
== begin of file clientTimeout.patch ===============
115c115
<       return new TServerSocket(serverSocket);
---
>       return new TServerSocket(serverSocket,timeout);
== end of file clientTimeout.patch ===============
{noformat} 
Please, correct me if i'm wrong 
                  
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Alexey Sviridov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216489#comment-13216489 ] 

Alexey Sviridov commented on THRIFT-1523:
-----------------------------------------

I'm have a simple patch, but dunno how to attach it here...
so i'm post it right here
{noformat}
== begin of file clientTimeout.patch ===============
115c115
<       return new TServerSocket(serverSocket);
---
>       return new TServerSocket(serverSocket,timeout);
== end of file clientTimeout.patch ===============
{noformat} 
Please, correct me if i'm wrong 
                
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Priority: Blocker
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1523) clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220710#comment-13220710 ] 

Hudson commented on THRIFT-1523:
--------------------------------

Integrated in Thrift #422 (See [https://builds.apache.org/job/Thrift/422/])
    THRIFT-1523: clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
Client: java
Patch: Alexey Sviridov

Adds server timeout to SSLTransportFactory (Revision 1296053)

     Result = SUCCESS
jfarrell : http://svn.apache.org/viewvc/?view=rev&rev=1296053
Files : 
* /thrift/trunk/lib/java/src/org/apache/thrift/transport/TSSLTransportFactory.java

                
> clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1523
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1523
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1, 0.7, 0.8, 0.9
>            Reporter: Alexey Sviridov
>            Assignee: Alexey Sviridov
>            Priority: Blocker
>             Fix For: 0.9
>
>         Attachments: clientTimeout.patch
>
>
> TSSLTransportFactory has method 
>    public static TServerSocket getServerSocket(int port, int clientTimeout) 
> there is parameter clientTimeout that need to close idle client connections (after clientTimeout amount of millis of client inactivity server closes opened connection themself, not waiting while client called close() method). This parameter work fine when create TServerSocket through new, but not working at all when creating TServerSocket through TSSLTransportFactory.getServerSocket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira