On Thu, Dec 5, 2013 at 7:03 PM, Thomas Eckert
<[email protected]>wrote:

> I'm not talking about retrying requests but retrying writing on the socket
> after trying to "re-"open a connection. When mod_proxy tries to forward the
> client request to the backends and encounters a closed connection due to
> the described race condition it will fail back to the client. Instead, I
> suggest trying to re-open the connection once and then either send the
> client request over that connection or go back to the client with an error.
> No double-sending requests anywhere.
>

I must be missing something.

When mod_proxy encounters a closed (reused) connection while forwarding the
client's request, it has just sent the request once, right?
If, in that case, it opens a new connection and send that same request on
it, this is the second time, still right?

Unless it didn't send the complete request the first time, I mean
deliberately by sending only part of the request (incomplete body if any,
or incomplete header otherwise), how can the proxy be sure the first
request has not been interpreted by the backend already?
This is not because the send() failed on the proxy side the backend has not
recv()ed all the bytes (there might be a problem with the ack of the last
bytes for example), hence the request could be valid from the backend side.

Is sending a partial request first what you'd like to (be) implement(ed),
and only if that succeeds send the remaining data?


> > Same as above, this can't be done (even less at the connection level).
> > There is really no overall solution, IMHO.
>
> I doubt that statement is correct. As I said before, I've seen it work
> with another proxy so the basic approach is no problem. You might be
> correct in that it's not possible with apache but I cannot confirm or
> disconfirm this until I have tried adding it.
>

A proxy that re-sends the same non-idempotent request twice is simply not
HTTP compliant (
http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25, 6.3.1.
Retrying Requests).

However, the RFC does not talk about incomplete requests.

Regards,
Yann.

Reply via email to