You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2019/07/26 05:43:45 UTC

[GitHub] [incubator-brpc] zhangwei17 commented on issue #856: brpc使用thrift协议时抛出apache::thrift::transport::TTransportException异常

zhangwei17 commented on issue #856: brpc使用thrift协议时抛出apache::thrift::transport::TTransportException异常
URL: https://github.com/apache/incubator-brpc/issues/856#issuecomment-515317370
 
 
   已定位到原因:
   由于server端在处理完请求后,并未返回结果数据(thrift定义的service中带有oneway标签),早早地便调用了done->run(),在client端的brpc框架请求后,对返回结果进行处理的时候,会认为返回的response里有数据,进而在解析的时候出现了异常。修改thrift_protocol.cpp文件中的ReadThriftStruct函数后正常。
   ```
   bool ReadThriftStruct(const butil::IOBuf& body, ThriftMessageBase *raw_msg, int16_t expected_tid)
   {
       const size_t body_len = body.size();
       **if (body_len <= 0)
       {
           RPC_VLOG << "no content for thrift parsing";
           return true;
       }**
       ......
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org