Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.19.0
-
None
Description
Saw a strange log when using cpp lib of thrift-0.16.0:
I1114 15:50:53.952184 16548 thrift-util.cc:196] TSocket::read() THRIFT_EAGAIN (timed out) after %f ms: Unknown error 30000
It's logged by this line
GlobalOutput.perror("TSocket::read() THRIFT_EAGAIN (timed out) after %f ms", recvTimeout_);
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():
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;
https://github.com/apache/thrift/blob/0.16.0/lib/cpp/src/thrift/TOutput.h
We should use GlobalOutput.printf() instead.
Attachments
Issue Links
- links to