Thomas Kielbus created THRIFT-2274:
--------------------------------------
Summary: TNonblockingServer and TThreadedSelectorServer do not
close their channel selectors on exit and leak file descriptors
Key: THRIFT-2274
URL: https://issues.apache.org/jira/browse/THRIFT-2274
Project: Thrift
Issue Type: Bug
Components: Java - Library
Reporter: Thomas Kielbus
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)
--
This message was sent by Atlassian JIRA
(v6.1#6144)