select(outfd) times out after send(outfd) returns ECONNRESET. bug?

From: Frank van Maarseveen
Date: Wed Feb 01 2006 - 04:17:30 EST


Saw this (strace -tt -T) on 2.6.14.2 and 2.6.14.6:

12:04:14.180892 accept(3, {sa_family=AF_INET, sin_port=htons(3232), sin_addr=inet_addr("172.17.2.206")}, [16]) = 8 <0.000048>
...
12:04:14.233478 select(1024, NULL, [8], NULL, {5, 0}) = 1 (out [8], left {5, 0}) <0.000032>
12:04:14.233871 send(8, "\0\252#\307G\355#\307G\355#\307G\355#\307G\355#\307G\355"..., 147, 0) = -1 ECONNRESET (Connection reset by peer) <0.000028>
12:04:14.234109 select(1024, NULL, [8], NULL, {5, 0}) = 0 (Timeout) <4.999045>
12:04:19.233456 select(1024, NULL, [8], NULL, {0, 0}) = 0 (Timeout) <0.000029>
...
12:04:19.246691 recv(8, "", 147, 0) = 0 <0.000028>
12:04:19.246888 shutdown(8, 2 /* send and receive */) = -1 ENOTCONN (Transport endpoint is not connected) <0.000017>
12:04:19.247069 close(8) = 0 <0.000043>


I thought the second (and third) select() call should have returned
immediately, flagging the fd of the reset connection as writable.


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