You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1997/01/18 20:08:53 UTC

lingering close

I would like to compare notes with others who are debugging this.
Rather than flood the list with what, at this point, is speculative
discussion, mail me privately and we'll begin building an alias for
whomever is interested.

I've looked at a lot of debug code coming from the area that I feel
shows a problem.

One thing that I have run across as I pour through the Steven's TCP
books is that it seems to me that FIN_WAIT_2 is a state passed off
to the kernel, and subsequent calls to shutdown() will not move
the state to TIME_WAIT. This leads me to think that unless the
kernel supports timeouts of FIN_WAIT_2, we are hurting ourselves
by using the half-close.

It also looks like we could write our own shutdown() that is a
bit smarter. Currently, I think that there is a race condition
present that allows us to call shutdown on a connection that is
no longer present. No biggie. But could help us debug this if we
do a better job of limiting the sockets that actually make it to
this routine.




Re: lingering close

Posted by Dean Gaudet <dg...@arctic.org>.
I'm curious why the second shutdown() is even required.  Just closing the
socket should be sufficient at that point.  There's also the possibility
of an os bug where doing shutdown(sd,2) after having done shutdown(sd,1) 
puts the socket into a screwed state.  So if the second shutdown is really
necessary for some reason then try changing it to shutdown(sd,0).

Dean

On Sat, 18 Jan 1997, Randy Terbush wrote:

> 
> I would like to compare notes with others who are debugging this.
> Rather than flood the list with what, at this point, is speculative
> discussion, mail me privately and we'll begin building an alias for
> whomever is interested.
> 
> I've looked at a lot of debug code coming from the area that I feel
> shows a problem.
> 
> One thing that I have run across as I pour through the Steven's TCP
> books is that it seems to me that FIN_WAIT_2 is a state passed off
> to the kernel, and subsequent calls to shutdown() will not move
> the state to TIME_WAIT. This leads me to think that unless the
> kernel supports timeouts of FIN_WAIT_2, we are hurting ourselves
> by using the half-close.
> 
> It also looks like we could write our own shutdown() that is a
> bit smarter. Currently, I think that there is a race condition
> present that allows us to call shutdown on a connection that is
> no longer present. No biggie. But could help us debug this if we
> do a better job of limiting the sockets that actually make it to
> this routine.
> 
> 
> 
>