mod_proxy fails to shutdown when client cancels
am 12.09.2002 00:40:49 von Noel Burton-Krahn
I have Apache-1.3.26 proxying requests to another back-end http server. If
the client cancels a connection while sending the parameters, the proxied
server does not see the connection close, and it hangs.
1. start a long file upload request
2. apache opens a new connection to the back-end
3. client cancells upload
4. the connection to apache closes
5. apache blocks reading the request from the back-end
6. since apche doesn't call shutdown() on the socket connected to the
back-end, the back-end server doesn't know the client broke the connection
and hangs waiting for more input.
See modules/proxy_http.c line 426. I think there should something like this
should be inserted on line 433:
if( i<=0) {
shutdown(1);
}
What do you think?
In the bigger scheme of things, its a bad idea for a proxy server to buffer
a whole request before reading the reply. Could mod_proxy be redone to pipe
both sides at once?
--Noel Burton-Krahn
Re: mod_proxy fails to shutdown when client cancels
am 12.09.2002 07:30:09 von Graham Leggett
Noel Burton-Krahn wrote:
> I have Apache-1.3.26 proxying requests to another back-end http server. If
> the client cancels a connection while sending the parameters, the proxied
> server does not see the connection close, and it hangs.
>
> 1. start a long file upload request
> 2. apache opens a new connection to the back-end
> 3. client cancells upload
> 4. the connection to apache closes
> 5. apache blocks reading the request from the back-end
> 6. since apche doesn't call shutdown() on the socket connected to the
> back-end, the back-end server doesn't know the client broke the connection
> and hangs waiting for more input.
As far as I was aware proxy already did this - will look further into
why this is broken.
> In the bigger scheme of things, its a bad idea for a proxy server to buffer
> a whole request before reading the reply.
The point behind buffering a whole or part of a request is to ensure
slow clients don't tie up resources on expensive backend processes.
Doing it this way has a significant performance advantage.
> Could mod_proxy be redone to pipe
> both sides at once?
This isn't a proxy limitation, but rather a limitation on the way the
filter stacks work. This problem has been highlighted before, and there
was some discussion not so long ago on fixing it, though I'm not sure
when it will happen :(
Regards,
Graham
--
-----------------------------------------
minfrin@sharp.fm "There's a moon
over Bourbon Street
tonight..."