You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James Grant (JIRA)" <ji...@apache.org> on 2010/04/16 17:10:25 UTC

[jira] Created: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

Generated client code does not set or check the sequence ID in messages
-----------------------------------------------------------------------

                 Key: THRIFT-760
                 URL: https://issues.apache.org/jira/browse/THRIFT-760
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (Java)
    Affects Versions: 0.2
            Reporter: James Grant
            Priority: Minor


The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

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

        

[jira] Commented: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

Bryan Duxbury commented on THRIFT-760:
--------------------------------------

@Marc - I'm confused as to how the server can send a message back to the wrong client. If that's the case, then this is a very serious issue which seems separate from the sequence ID stuff.

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

Bryan Duxbury closed THRIFT-760.
--------------------------------

         Assignee: James Grant
    Fix Version/s: 0.3
       Resolution: Fixed

I just committed this patch. Thanks for the contribution, James!

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Assignee: James Grant
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

James Grant updated THRIFT-760:
-------------------------------

    Attachment: thrift-seqid.patch

Attached a patch for the Java generator that sets and checks the sequence ID

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

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

        

[jira] Commented: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

Posted by "Marc de Palol (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859797#action_12859797 ] 

Marc de Palol commented on THRIFT-760:
--------------------------------------

Indeed. 

This bug caused me serious trouble. Under high load the server can respond a message to a wrong client. Then the client thinks that the response is right and continues its workflow with wrong data, instead it should fail and retry the call. Of course this should be handled at application level, but at least there should be a way to know that the data it got is not what's meant to be. 

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

James Grant updated THRIFT-760:
-------------------------------

    Patch Info: [Patch Available]

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

James Grant commented on THRIFT-760:
------------------------------------

This change is only for the client. I have checked the server part of the generator for C++, Python, C#, PHP and Java and they all correctly return the seqid sent in the request.

This change only checks that value and throws an exception when they do not match.

The current behavior will either fail with a protocol error or return an incorrect result. Although the patch I supplied only applies to the Java client I think the same change should be made to the other languages.

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-760) Generated client code does not set or check the sequence ID in messages

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

Bryan Duxbury commented on THRIFT-760:
--------------------------------------

I think this is generally cool, but won't it break Java's ability to interact with any language that doesn't implement the seqid functionality yet? My impression is that we've left the capability, but not yet implemented it anywhere.

> Generated client code does not set or check the sequence ID in messages
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-760
>                 URL: https://issues.apache.org/jira/browse/THRIFT-760
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>    Affects Versions: 0.2
>            Reporter: James Grant
>            Priority: Minor
>         Attachments: thrift-seqid.patch
>
>
> The sequence ID is never set in the generated client code. It is also never checked. This means that if you continue to use a connection after a socket timeout the returned results can arrive out of sequence. When this happens an exception should be thrown so that incorrect results are never returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.