Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.5
-
None
-
c++ client
Description
While researching JIRA QPID-2367 I noticed a pileup of file descriptors in /proc/PID/fd. I traced the creation of these descriptors back to this chunk of code in qpid/sys/epoll/EpollPoller.cpp:
244 PollerPrivate() :
245 epollFd(::epoll_create(DefaultFds)),
246 isShutdown(false)
The problem is with the second QPID_POSIX_CHECK – a macro that throws an exception. If an exception is thrown then the file descriptor allocated by epollFd(::epoll_create(DefaultFds)) is left dangling. A ::close(epollFd) would be needed in the catch() block to free it.
There are a number of functions with a similar design in EpollPoller.cpp that might be similarly affected.