qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Huston" <shus...@riverace.com>
Subject RE: Operation not permitted (qpid/sys/epoll/EpollPoller.cpp:254)
Date Wed, 27 Jan 2010 17:37:18 GMT
Hi Jason,

> On Mon, Jan 25, 2010 at 6:54 PM, Steve Huston 
> <shuston@riverace.com> wrote:
> > alwaysReadableFd is for a pipe - is there a chance you've closed it?
> I think there is.  It looks like the static scope of 
> alwaysReadable and alwaysReadableFd cause them to get 
> initialized before main(). When my daemon class closes open 
> file descriptors while fork()ing they get closed.  I still 
> have to figure out how to resolve the conflict.

Right - this seems to be the main problem to solve here. Could you
please open a jira for it?

> There is, however, still a bug in the code I originally cited:
>     PollerPrivate() :
>         epollFd(::epoll_create(DefaultFds)),
>         isShutdown(false) {
>         QPID_POSIX_CHECK(epollFd);
>         ::sigemptyset(&sigMask);
>         // Add always readable fd into our set (but not 
> listening to it yet)
>         ::epoll_event epe;
>         epe.events = 0;
>         epe.data.u64 = 0;
>         QPID_POSIX_CHECK(::epoll_ctl(epollFd, EPOLL_CTL_ADD, 
> alwaysReadableFd, &epe));
>     }
> If an exception is thrown by the second QPID_POSIX_CHECK then 
> the file descriptor allocated by 
> epollFd(::epoll_create(DefaultFds)) is left dangling.

Ahh, right... The destructor won't be called if the second
QPID_POSIX_CHECK throws. Could you please also open a jira for this?

> 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.

If you could note those in the jira, that would be appreciated.


Steve Huston, Riverace Corporation
Total Lifecycle Support for Your Networked Applications

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

View raw message