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

TNonblockingServer and TThreadedSelectorServer do not close their channel selectors on exit and leak file descriptors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.2
    • Component/s: Java - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      TNonblockingServer and TThreadedSelectorServer do not close their channel selectors on exit and do not release all ressources.

      This is an issue especially when such server implementations are started and stopped repeatedly within the same JVM. In our use case, we see hundreds of file descriptors being leaked on each Thrift server restart. We hit the OS limit on the number of open files pretty quickly.

      The attached patch fixes the issue by simply calling Selector.close() when the relevant select threads exit (TNonBlockingServer::SelectAcceptThread, TThreadedSelectorServer::SelectorThread, TThreadedSelectorServer::AcceptThread)

        Attachments

        1. thrift-2274.patch
          2 kB
          Thomas Kielbus

          Issue Links

            Activity

              People

              • Assignee:
                roger Roger Meier
                Reporter:
                thomas_kielbus Thomas Kielbus
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: