From: "Miquel van Smoorenburg" <miquels@cistron.nl>
To: linux-kernel@vger.kernel.org
Subject: Re: TCP hangs in 2.4 - blocking write() in wait_for_tcp_memory
Date: Wed, 30 Oct 2002 10:44:20 +0000 (UTC) [thread overview]
Message-ID: <apod64$sv5$1@ncc1701.cistron.net> (raw)
In-Reply-To: apme9u$n2n$1@ncc1701.cistron.net
In article <apme9u$n2n$1@ncc1701.cistron.net>,
Miquel van Smoorenburg <miquels@cistron.nl> wrote:
>On the gateway machine, the proxy consistantly hangs in a write().
>I've replaced the squid proxy with a simple perl script + nc to
>make sure it isn't a squid-related problem..
Right, I found the cause of the problem, but I'm not sure if the
application of the kernel is wrong here.
On 2 machines do this:
machine1# socket -s 12345 < /dev/zero > /dev/null # server
machine2# socket -w machine1 12345 < /dev/zero # client
The first command starts a listening process on port 12345, that
sends an infinite stream of zeros to the remote side and sinks
all data received.
The second command connects to the first machine, sends an
infinite stream of zeros, but never does a read() on the socket
(the '-w' option).
The 'socket' program doesn't make the sockets non-blocking, it just
does a select() loop to find out readability/writeability on the
file descriptors.
This makes both socket programs hang in write(), in wait_for_tcp_memory.
Shouldn't the kernel return a short write, instead of hanging
both processes ? select() returned writeability.
As I described in my first mail, this happens in the real world
as well - an application is writing lots of data to the remote
side, while the remote side is sending data too - hang.
Oh, tested it on 2.4.19 and 2.4.20-pre11
Mike.
next prev parent reply other threads:[~2002-10-30 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-29 16:51 TCP hangs in 2.4.20-pre11 (and 2.4.19) Miquel van Smoorenburg
2002-10-30 10:44 ` Miquel van Smoorenburg [this message]
2002-10-30 12:28 ` TCP hangs in 2.4 - blocking write() in wait_for_tcp_memory bert hubert
2002-10-30 12:44 ` Miquel van Smoorenburg
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='apod64$sv5$1@ncc1701.cistron.net' \
--to=miquels@cistron.nl \
--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