You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/06/09 03:51:00 UTC

[jira] [Commented] (THRIFT-3182) TFramedTransport is in an invalid state after frame size exception

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

ASF GitHub Bot commented on THRIFT-3182:
----------------------------------------

Github user marshalium commented on the pull request:

    https://github.com/apache/thrift/pull/512#issuecomment-110194778
  
    Jira opened: https://issues.apache.org/jira/browse/THRIFT-3182
    
    I added the new exception as a subclass of TTransportException exception type because I think it's more user friendly to catch specific exception subclasses when the user of the api cares to. Is it more the Thrift style to add another type constant to TTransportException and not subclass? That way a user has to catch TTransportException and then switch on type.
    
    I think users may want to handle this exception differently because it can mean that the client has a misconfigured frame size or is requesting too much data.
    
    Looking at some of the other clients (for example: https://github.com/apache/thrift/blob/master/lib/csharp/src/Transport/TFramedTransport.cs) they don't seem to even enforce that the frame size is valid. But I think they could all be updated to both validate the frame size and properly close the transport when they read an invalid one.


> TFramedTransport is in an invalid state after frame size exception
> ------------------------------------------------------------------
>
>                 Key: THRIFT-3182
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3182
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9.2
>            Reporter: Marshall Scorcio
>
> https://github.com/apache/thrift/pull/512
> This is necessary because after reading the invalid
> frame size from the underlying transport the transport
> is left in a bad state. Any following reads will
> likely throw more invalid frame size exceptions and
> if they don’t they will be reading corrupted messages.
> Closing forces the caller to discard the connection and
> get a new one.



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