[Dovecot] 1.0-test75 and roadmap for v1.0
Dominic Marks
dom at goodforbusiness.co.uk
Tue Jul 12 20:55:24 EEST 2005
On Tuesday 12 July 2005 17:28, Timo Sirainen wrote:
> On Tue, 2005-07-12 at 16:07 +0100, Dominic Marks wrote:
> > > > io_loop_handle_remove() should always be called before close(),
> > > > so kevent() should never fail. What am I missing?
> >
> > Seems to be the other way around, since I can work around the
> > warning by using fstat to check if the descriptor is in use. I
> > currently have this:
> >
> > if (kevent(data->kq, &data->event, 1, NULL, 0, NULL) < 0) {
> > if (fstat(fd, NULL) == 0) {
> > /*
> > * Trying to remove filters on a closed descriptor
> > * will cause kevent(2) to return an error. If we
> > * sure that descriptors are ALWAYS closed before
> > * this function we can delete the entire function
> > * body.
> > */
> > i_warning("couldn't remove filter on fd %d with kqueue:
> > %m", fd); }
>
> Uhm. I think Dovecot's code should rather be fixed so the function
> doesn't get called with closed file descriptors. I'm not sure if it's
> possible everywhere without larger changes though..
Ok.
> Anyway I don't think you should add the extra fstat() there, not
> giving a warning if EBADF error comes is just as good without extra
> syscall.
Makes sense, I've changed the code.
My work in progress:
http://www.helenmarks.co.uk/~dom/dovecot/ioloop-kqueue.c
I'll keep tinkering with the io prioritisation stuff, but I
can't get it run properly as yet.
Thanks,
--
Dominic Marks
More information about the dovecot
mailing list