Hi Jason,

> On Mon, Jan 25, 2010 at 6:54 PM, Steve Huston 
> <shus...@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.

Thanks,
-Steve

--
Steve Huston, Riverace Corporation
Total Lifecycle Support for Your Networked Applications
http://www.riverace.com


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

Reply via email to