[Dovecot] RE: epoll error when running as proxy
Also, for testing in the error message I patched src/lib/ioloop-epoll.c to show the "ret" and "errno" variables as well as the variable names, which is why there is a bit of extra data in this error message...
imap-login: io_loop_handle_add: epoll_ctl(op=3, fd=10, ret=-1, errno=2): No such file or directory
Bill
On Thursday, February 9, 2006 16:32, Bill Boebel said:
I don't know enough about epoll to answer that. I do see that in src/lib/ioloop-epoll.c, the "io_loop_handler_init()" function calls this, which sounds related.:
fd_close_on_exec(ctx->epfd, TRUE);
But again, I am not very familiar with the specifics of epoll. Maybe somebody else on this list knows?
Thanks, Bill
Bill Boebel wrote:
And to answer my own question (question/answer 6): http://www.die.net/doc/linux/man/man4/epoll.4.html
I think it might be the cause of the error message.
Thanks, Bill
VH
Interesting. The error is occurring during an EPOLL_CTL_MOD operation within the io_loop_handle_add() function. So I am not positive that what you point out is in fact the problem. If it was occurring within the io_loop_handle_remove() function then what you point out might be the case, but thats not where its happening. Unless maybe it is referencing the wrong file descriptor in it's io_list because of a previous file descriptor getting closed unexpectedly. Hmm...
I am surprised nobody else has mentioned this error on the list before. It seems like it would be rather common.
Bill
On Thursday, February 9, 2006 17:56, Václav Haisman said:
It has been mentioned I think:
http://dovecot.org/list/dovecot/2005-October/thread.html#9626 with the thread "[Dovecot] errors after 1.0a3 -> 1.0a4"
But it was implicated with SSL at the time, although, you've suggested that it may not in fact be anything to do with SSL at all..
[I'm seeing it after 5 or so mins using Thunderbird, but I'm just building without epoll for now]
reuben
On 10/02/2006 12:55 p.m., Bill Boebel wrote:
Bill Boebel wrote:
- If I switch to poll instead of epoll, everything works fine. Any ideas?
epoll is broken since 1alpha4. By chance, I looked into the code tonight and found that io_loop_handle_add calls epoll_ctl sometimes with MOD on fds that were just DELeted before. This is caused by iolist_del, which always returns TRUE. I don't fully understand the code (and it looks a little overcomplicated to me, considering the epoll code I wrote myself), but the attached mini patch makes epoll work again in my setup. Don't know if this is a complete fix, though. Timo, could you look into this and confirm/negate, please? --- dovecot/src/lib/ioloop-epoll.c +++ dovecot.epoll/src/lib/ioloop-epoll.c @@ -139,7 +139,7 @@ if (list->ios[i] == io) list->ios[i] = NULL; else - last = TRUE; + last = FALSE; } } return last;
On Thursday, February 9, 2006 20:39, Jakob Hirsch said:
This patch worked in our environment too - thanks Jakob. The "io_loop_handle_add: epoll_ctl" errors went away and the IMAP proxy works as expected now.
I don't fully understand what this patch does to the epoll data structures though... Can somebody confirm that this change is safe and its not going to create any leaks or other weirdness?
Bill
participants (5)
-
Bill Boebel
-
Jakob Hirsch
-
Reuben Farrelly
-
Timo Sirainen
-
Václav Haisman