lkml.org 
[lkml]   [2009]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PROBLEM: Epoll frequently fails to notify connects at connect bursts
On Tue, 25 Aug 2009, Davide Libenzi wrote:

> On Wed, 26 Aug 2009, Will Brown wrote:
>
> > PLEASE CC: ME ON ANY REPLIES, thank you.
> >
> > *** 1. Epoll frequently fails to notify connects at connect bursts
> >
> > *** 2. Sometimes, when several connects come in quickly, epoll
> > establishes tcp connections (according to 'netstat') but then fails to
> > notify the application by returning from epoll_wait(). In those cases
> > a subsequent connection or an EPOLLIN or EPOLLOUT event can cause a
> > return from epoll_wait(), which then causes the previously ignored
> > connection to be reported. But then the more recent event is not
> > notified, the whole sequence lags and everything gets out of whack.
> > The problems can easily be reproduced on my Ubuntu machine which runs
> > a kernel version 2.6.28 using supplied test program. I also have a
> > Ubuntu hosted in VMWare running a 2.6.27 version kernel, which appears
> > to NOT have the same problem.
>
> Multiple quasi-simultaneous events for the same fd are merged. This is why
> on POLLIN on accepting sockets you want to do something like:
>
> while ((afd = accept(sfd, ...)) != -1)
> add_client(afd);

Of course, with sfd in non-blocking mode. Alternatively, you drop EPOLLET
for the sfd socket.


- Davide




\
 
 \ /
  Last update: 2009-08-26 03:27    [W:0.100 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site