mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* accept()ing socket connections with level triggered epoll
@ 2006-04-26 20:55 kyle
  2006-04-26 21:11 ` Heikki Orsila
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: kyle @ 2006-04-26 20:55 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: linux-kernel

Hello,

I think I may have found a bug in Linux's implementation of epoll.  My
program creates a server socket that listens for incoming SOCK_STREAM
connections.  It uses epoll to wait for notification of a new connection
(and also to handle the client sockets).  While the client sockets use edge
triggered epoll, for performance reasons, the server socket uses level
triggered epoll.

I have found that when I open connections to my program very quickly, it is
sometimes possible to call accept more than once before reaching the point
where no more connections are available and EAGAIN is returned.  If I return
to epoll_wait without accepting all of the available connections, I should
immediately be notified that a read is still available on the server socket,
since I am using level triggered epoll for that descriptor (at least that is
my understanding of how all of this is supposed to work ;).  However, epoll
does not make this notification.  Even if the program accepts further
incoming connections, the missed connection is never accepted, and
eventually times out on the client side.

Kernel version is 2.6.9.  I can provide test code if needed.

Thanks,
Kyle Cronan
<kyle@pbx.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-27  4:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 20:55 accept()ing socket connections with level triggered epoll kyle
2006-04-26 21:11 ` Heikki Orsila
2006-04-26 21:14 ` Davide Libenzi
2006-04-27  0:05   ` kyle
2006-04-27  4:07     ` Willy Tarreau
2006-04-26 21:20 ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®