[
https://issues.apache.org/jira/browse/THRIFT-3673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15181531#comment-15181531
]
Aki Sukegawa edited comment on THRIFT-3673 at 3/5/16 5:22 AM:
--------------------------------------------------------------
After TTransportException, it is generally impossible to reuse the same client
any more, you need to create a fresh one.
As to the skip, the code path is for when receiving unexpected fields.
It helps when communicating between different versions of your IDLs (i.e. added
fields).
In this case, it is only a desperate attempt to recover from corrupt transport
state that is deemed to fail by design.
was (Author: nsuke):
After TTransportException, is generally impossible to reuse the same client any
more, you need to create a fresh one.
As to the skip, the code path is for when receiving unexpected fields.
It helps when communicating between different versions of your IDLs (i.e. added
fields).
In this case, it is only a desperate attempt to recover from corrupt transport
state that is deemed to fail by design.
> API fails with std::exception after a timeout occured in earlier any API call
> -----------------------------------------------------------------------------
>
> Key: THRIFT-3673
> URL: https://issues.apache.org/jira/browse/THRIFT-3673
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.9.1
> Environment: Windows
> Reporter: SABU DANIEL
> Priority: Critical
>
> Any API calls( from client to server) fails with std::exception after a
> timeout occurred in earlier API call.
> Steps:
> 1) Call a Server API which doesn't finish within the socket read timeout
> 2) This call throws apache::thrift::transport::TTransportException with a
> TIMEOUT type (Excepted)
> 3) Call Another API, this fails because the earlier call response data in the
> socket read buffer.
> // Here is the part of generated code in client
> void ClientGeneratedClass::recv_[CURRENTAPI_NAME]
> {
> ...
> ..
> ..
> if (fname.compare([CURRENTAPI_NAME]) != 0) {
> iprot_->skip(::apache::thrift::protocol::T_STRUCT);
> iprot_->readMessageEnd();
> iprot_->getTransport()->readEnd();
> }
> }
> This iprot_->skip doesn't seems to be cleaning the read buffer correctly.
> Please advise any workaround or solution for this.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)