[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] epoll erros



On Thu, Sep 16, 2010 at 2:59 PM, Gilad Benjamini
<gilad@xxxxxxxxxxxxxxxxx> wrote:
> My Linux code, which uses libevent 2.0.x occasionally prints these error
> messages
>    Epoll ADD on fd 14 failed.  Old events were 0; read change was 1 (add);
> write change was 0 (none).: File exists
> When they appear, it can be as frequent as once a second.
>
> Can someone shed some light on what the issue might be ?

First, make sure you're on 2.0.7-rc, not just any "2.0.x";  there was
an error like this that got fixed in 2.0.6-rc.

So the message means that libevent's epoll backend told the kernel to
start listening for reads on fd 14.  Libevent believed that it was not
previously watching fd 14, so it used EPOLL_ADD rather than EPOLL_MOD
to add it.  The kernel, though, disagreed, and gave an EEXIST error
("file exists") to say, "no, I was already watching events on that fd.

Two possibilities here: one is that Libevent is confused about which
fds it was listening on.  Another one is that something in your code
screwed up Libevent's view of which fds it was listening on.

The first thing to do here is to use event_enable_debug_mode() to have
libevent track event adds/deletes/etc to make sure that there's
nothing screwy going on there.

yrs,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.