On Thu, Dec 13, 2007 at 12:35:03PM +0100, Otto Moerbeek wrote:
:
The behaviour is starting to make sense now. Scenario:
* The client connects to the server, sends its request and
then closes the socket, that is shutdown() aka half-close.
It can still read the reply.
* The server accepts the connection, reads the request,
and may or may not notice that the client has done
a shutdown() - it is not important. Nevertheless the
server can not close the socket since it has a
reply to deliver. And the server host TCP stack
has noticed the shutdown() so the socket already
enters CLOSE_WAIT.
* The server starts sending the reply which may be large
e.g a file download. In the middle of this transfer
the client's ethernet cable gets plugged out, the
client host gets powered off, a firewall in the
path goes bananas or whatnot.
* The server is now stuck in a write() call since the
server host TCP stack has to wait quite a while
to be sure the connection is really dead.
And the state is still CLOSE_WAIT.
If the client program would die, the client host TCP
stack would close the socket and tell the server host
TCP stack, that would fail the hanging write() call.
So there must be a harder error such as network
outage or power outage to induce this problem.
If this scenario is correct, there is nothing to do
about it, except decreasing the likelyhood of the
server socket being half-closed while sending
the reply, and having KeepAliveTimeout in
httpd.conf at its default (15) or slightly lower
seems to do the trick. But I do not know how.
If there is some quirk in httpd's implementation
of the KeepAliveTimeout that makes it not notice
the half-close and keeps the socket open the whole
KeepAliveTimeout, that would explain it.
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Alan Cox | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | Re: [GIT]: Networking |
| Evgeniy Polyakov | Re: [BUG] New Kernel Bugs |
