Re: 2.2.0-final - TCP connections hang *again*

Andi Kleen (ak@muc.de)
23 Jan 1999 11:33:15 +0100


In article <pgpmoose.199901230032.7398@pccross.average.org>,
crosser@average.org (Eugene Crosser) writes:
> Until 2.1.1xx (early '100s), there was a bug that resulted in processes
> hanging on TCP connections. Now and then, I have hundreds of "inews -h"
> processes running at the same time. Some percent of them stay forever,
> connection (over the local interface) is "ESTABLISHED" from one side and
> "SYN_RECV" from the other side. At one moment, IP guys fixed this and
> this effect disappered.

This is a bug in the proc/net/tcp openreq printing code. It happens when
the application does not call accept() in time, then the pending accepts
will be printed as SYN_RECV still although they are already established.

This patch should fix the printing, of course it doesn't fix the application
to call accept in time.

BTW, don't trust the SYN_RECV listing code too much, it might miss some sockets
when the socket listing is longer than PAGE_SIZE.

--- linux/net/ipv4/proc.c.~1~ Tue Dec 29 00:27:07 1998
+++ linux/net/ipv4/proc.c Sat Jan 23 11:28:28 1999
@@ -184,6 +184,8 @@

for (req = sp->tp_pinfo.af_tcp.syn_wait_queue; req;
i++, req = req->dl_next) {
+ if (req->sk)
+ continue;
pos += 128;
if (pos < offset)
continue;

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/