Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5670

recvTimeout is not printed correctly for THRIFT_EAGAIN

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.19.0
    • 0.20.0
    • C++ - Library
    • 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

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m