You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andrew Stitcher (JIRA)" <qp...@incubator.apache.org> on 2010/01/28 16:39:34 UTC

[jira] Updated: (QPID-2368) Exception Thrown at qpid/sys/epoll/EpollPoller.cpp:254 Leaves Orphan File Descriptor

     [ https://issues.apache.org/jira/browse/QPID-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Stitcher updated QPID-2368:
----------------------------------

    Priority: Minor  (was: Major)

It's clearly true that an exception here will leak the epoll Fd, however in that case the entire library will fail to function at all. So all you could do would be to exit the process, in that case I don't see the leak as all that important.

Not to say it shouldn't be fixed, just that its priority is fairly low.

> Exception Thrown at qpid/sys/epoll/EpollPoller.cpp:254 Leaves Orphan File Descriptor
> ------------------------------------------------------------------------------------
>
>                 Key: QPID-2368
>                 URL: https://issues.apache.org/jira/browse/QPID-2368
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Client
>    Affects Versions: 0.5
>         Environment: c++ client
>            Reporter: Jason Schlauch
>            Priority: Minor
>
> 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) {
> 247         QPID_POSIX_CHECK(epollFd);
> 248         ::sigemptyset(&sigMask);
> 249         // Add always readable fd into our set (but not listening to it yet)
> 250         ::epoll_event epe;
> 251         epe.events = 0;
> 252         epe.data.u64 = 0;
> 253         QPID_POSIX_CHECK(::epoll_ctl(epollFd, EPOLL_CTL_ADD, alwaysReadableFd, &epe));
> 254     }
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org