Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection - Mailing list pgsql-hackers

From Alan Cox
Subject Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection
Date
Msg-id E139EuC-0005jk-00@the-village.bc.nu
Whole thread Raw
In response to Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>     3.  If the connection is in a synchronized state (ESTABLISHED,
>     FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
>     any unacceptable segment (out of window sequence number or
>     unacceptible acknowledgment number) must elicit only an empty
>     acknowledgment segment containing the current send-sequence number
>     and an acknowledgment indicating the next sequence number expected
>     to be received, and the connection remains in the same state.
> 
> Therefore, sending data to a no-longer-present receiver does not cause
> a connection reset (at least not in a spec-conforming TCP stack), and
> there is no justification for discarding data that is coming the other
> way.
> 
> The Linux kernel's present behavior is contrary to the standard, unable
> to support an essential user capability (ie, delivery of last-gasp error
> messages), and contrary to the behavior of all other TCP implementations
> that I have worked with.  There is a reason why you are in the minority
> here...

Reread the 3. above. What it actually requires if you think about it is that
the receive window is shrunk to zero and the connection hangs for all
eternity the way you are arguing it.

Alan



pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: [GENERAL] Revised Copyright: is this more palatable?
Next
From: Alan Cox
Date:
Subject: Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection