[Dovecot] File descriptor leak in 1.0rc2[45]?

Timo Sirainen tss at iki.fi
Tue Mar 6 16:38:12 EET 2007


On Tue, 2007-03-06 at 08:49 -0500, Victor Duchovni wrote:
> On Tue, Mar 06, 2007 at 03:20:26PM +0200, Timo Sirainen wrote:
> 
> > On Mon, 2007-03-05 at 15:51 -0500, Victor Duchovni wrote:
> > > 
> > > I upgraded (NetBSD 2.99 i386) from 1.0rc7 to 1.0rc24 and then tried
> > > rc25,
> > > and in both cases need to restart Dovecot every day or so (low volume
> > > server).
> > > It seems to run out of file descriptors. I have now raised the file
> > > descriptor
> > > limit to 1024, but that is not a long-term solution... 
> > 
> > I guess you built with kqueue code?
> 
> I used the pkgsrc defaults. It looks like this uses kqueue. I am puzzled
> why kqueue introduces descriptor leaks.
> 
> > It seems to be buggy with older NetBSDs.
> 
> Is "it" the kqueue code in the kernel (how does this lead to descriptor
> leaks) or the kqueue-using event code in Dovecot (how does this lead
> to descriptor leaks).

Dovecot creates a log pipe for each child process. When the child
process dies, the log pipe should get a notification that there's new
data to be read from the pipe. Then when Dovecot tries to read() it, it
returns "end of file" and the pipe gets closed.

Something in the above doesn't work with some NetBSD versions + kqueue
and the pipe doesn't get closed.

> What can I do to work around the issue?

Remove --with-ioloop=kqueue from the pkgsrc build.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070306/58a5f1b3/attachment-0001.pgp 


More information about the dovecot mailing list