The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Michael Noisternig <mnoist@cosy.sbg.ac.at>
To: linux-kernel@vger.kernel.org
Subject: (more) epoll troubles
Date: Sun, 31 Aug 2008 15:38:01 +0200	[thread overview]
Message-ID: <48BA9EB9.3040701@cosy.sbg.ac.at> (raw)

Hello,

and sorry again if this is the wrong place to ask (again, please hint to 
me to an appropriate place to ask in that case).

After experimenting with epoll edge-triggered mode I am clueless why on 
a few occassions I seem to not get any input notification despite data 
is available.

In detail: I have set up sockets with epoll events 
EPOLLET|EPOLLRDHUP|EPOLLIN. When I get EPOLLIN for a socket, I read() as 
long as I get what I asked for, i.e. whenever read() returns either 
EAGAIN or less data than I asked for I take this as indication that I 
must wait for another EPOLLIN notification. However, this does not seem 
to work always.

Here is some log from my program:

0x9e6b8a8: read not avail (1460/2048 read)
i.e. tried to read 2048 bytes, got 1460 -> assume must wait for EPOLLIN 
for more data to read
(note that the fd is always in the epoll set with 
EPOLLET|EPOLLRDHUP|EPOLLIN)

0x9e6b8a8: read not avail (1460/2048 read)
got EPOLLIN notification, read 1460 bytes again -> wait for another 
notification

...after a few minutes without any notification...

0x9e6b8a8: GOT RDHUP (2001:0/80002001:0)
i.e. got notification for EPOLLRDHUP|EPOLLIN (2001), was waiting for 
EPOLLET|EPOLLRDHUP|EPOLLIN (80002001)

0x9e6b8a8: read not avail (342/2048 read)
then on trying to read we find data in the buffer (???)

0x9e6b8a8: stored 16384 bytes
this is the amount of data we expected to get /immediately/, i.e. 
without a minutes delay and rdhup

Of course you might think that the other side sent the data only just 
before closing its side, but it is unlikely since we expected to get the 
16384 bytes in one go (this is how that L7 protocol works), and I see 
this odd behaviour of missing input notifications now and then.

Does anybody know/have an idea why I am missing EPOLLIN notifications?

Any help is appreciated!!! Thanks in advance,
Michael
(please CC me when replying)

             reply	other threads:[~2008-08-31 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-31 13:38 Michael Noisternig [this message]
2008-09-03  5:57 ` (more) epoll troubles Andrew Morton
     [not found] <fa.zt4K08zThcs3bS6QJSiWmdw4amQ@ifi.uio.no>
2008-09-01 17:31 ` Robert Hancock
2008-09-01 17:32   ` Robert Hancock
2008-09-01 18:29     ` Michael Noisternig
2008-09-01 18:46       ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48BA9EB9.3040701@cosy.sbg.ac.at \
    --to=mnoist@cosy.sbg.ac.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox