From: Kern Sibbald <kern@sibbald.com>
To: linux-kernel@vger.kernel.org
Subject: PROBLEM: blocking read on socket repeatedly returns EAGAIN
Date: Tue, 16 Aug 2005 15:19:39 +0200 [thread overview]
Message-ID: <200508161519.39719.kern@sibbald.com> (raw)
A read() on a TCP/IP socket, which should block returns -1 with errno=EAGAIN
Unless I am mistaken, the read() should block as the socket is active with no
problems. The only "unusual" items are that I have set the network buffer
size to 32K (32 * 1024), IPTOS_THROUGHPUT, and keepalive. In addition, I put
a lot of data into the write side of the socket, then do the read(). The
other end of the socket is perfectly alive, but does not read() the data I
have written, nor does it write() anything. When my read() is issued, I
expect it to block, but it immediately returns with -1 and errno set to
EAGAIN. If the read() is re-issued, a CPU intensive loop results as long as
the other end does not read() the data written to the socket. This is a
multi-threaded program, but the other threads are all blocked on something.
Kernel: Fedora FC4
Linux version 2.6.12-1.1398_FC4smp (bhcompile@tweety.build.redhat.com) (gcc
version 4.0.0 20050519 (Red Hat 4.0.0-8)) #1 SMP Fri Jul 15 01:30:13 EDT 2005
This problem occurs in my network backup program, Bacula, so it would be a
fair amount of work to send you a program that shows this behavior.
Best regards,
Kern
next reply other threads:[~2005-08-16 13:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-16 13:19 Kern Sibbald [this message]
2005-08-16 14:03 ` Alan Cox
2005-08-16 14:12 ` Kern Sibbald
2005-08-16 14:52 ` Alan Cox
2005-08-16 14:38 ` Kern Sibbald
2005-08-16 18:39 ` David S. Miller
2005-08-16 21:06 ` Kern Sibbald
2005-08-16 18:37 ` David S. Miller
2005-08-16 18:36 ` David S. Miller
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=200508161519.39719.kern@sibbald.com \
--to=kern@sibbald.com \
--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
all inboxes | Powered by JetHome®