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

TNonblockingServer blocked int addTask(IOThread) and notify(workerThread)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.12.0
    • 0.14.0
    • C++ - Library
    • None

    Description

      hello!

      when using c++ TNonblockingServer(with thread pool),I found it blocked in high QPS status.

      I used pstack to print thread stack and found worker thread and IO thread blocked at:

      The worker thread will call notifyIOThread when it handle expired task, then call TNonblockingIOThread::notify and wait for POLLOUT in poll without timeout. 

      The IO thread will call addTask when it gets requests. And IO threads will lock threadManager->mutex_ in addTask without a timeout

      Is it a bug of thrift 0.12.0?

      Attachments

        1. CppClient.cpp
          3 kB
          Fei Sun
        2. CppServer.cpp
          6 kB
          Fei Sun
        3. deadlock_thread.png
          30 kB
          Fei Sun
        4. wait_timeout.png
          40 kB
          Fei Sun

        Issue Links

          Activity

            People

              kanishthkarthik Kanishth Karthik
              chenguang9239 chenguang9239
              Votes:
              1 Vote for this issue
              Watchers:
              4 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 - 20m
                  20m