[
https://issues.apache.org/jira/browse/THRIFT-639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046914#comment-13046914
]
Ilya Maykov commented on THRIFT-639:
------------------------------------
I think you're supposed to throw away your connection/transport and re-create
them when you get an error (and timeouts are a kind of error), because an error
can be raised at any time and leave your connection/transport in an undefined
state. At least, that's what Twitter's thrift_client gem (higher-level client
on top of Thrift) does and it works pretty well in my experience.
> Timeouts Interrupting Read Can Leave Data in Read Queue, Corrupting Later
> Reads
> -------------------------------------------------------------------------------
>
> Key: THRIFT-639
> URL: https://issues.apache.org/jira/browse/THRIFT-639
> Project: Thrift
> Issue Type: Bug
> Components: Ruby - Library
> Affects Versions: 0.1, 0.2
> Reporter: Emily Leathers
> Priority: Minor
>
> When a Timeout interrupts a client that is reading a Thrift response, the
> client may leave unread bytes in the read queue. If this transport
> instance/queue is reused in a later request, the extra bytes will corrupt
> that later response.
> We're currently working around this by having the rescue blocks of our
> TimeoutExceptions close the transport so that subsequent requests will have
> to create a new, clean one.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira