Quanlong Huang created THRIFT-5670:
--------------------------------------

             Summary: recvTimeout is not printed correct of THRIFT_EAGAIN error
                 Key: THRIFT-5670
                 URL: https://issues.apache.org/jira/browse/THRIFT-5670
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.17.0, 0.16.0
            Reporter: Quanlong Huang
            Assignee: Quanlong Huang


Saw a strange log when using cpp lib of thrift-0.16.0:
{noformat}
I1114 15:50:53.952184 16548 thrift-util.cc:196] TSocket::read() THRIFT_EAGAIN 
(timed out) after %f ms: Unknown error 30000
{noformat}
It's logged by this line
{code:cpp}
GlobalOutput.perror("TSocket::read() THRIFT_EAGAIN (timed out) after %f ms", 
recvTimeout_);
{code}
added by this commit since 0.16.0:
[https://github.com/apache/thrift/commit/b31377f0a1813d3b0cb9afd0efc67b61ca021c67]

recvTimeout_ is incorrectly used as errno_copy in GlobalOutput.perror():
{code:cpp}
class TOutput {
  ...
  void perror(const char* message, int errno_copy);
  inline void perror(const std::string& message, int errno_copy) {
    perror(message.c_str(), errno_copy);
  }

  void printf(const char* message, ...);
};
THRIFT_EXPORT extern TOutput GlobalOutput;{code}
https://github.com/apache/thrift/blob/0.16.0/lib/cpp/src/thrift/TOutput.h

We should use GlobalOutput.printf() instead.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to