>
>
> > I traced back that change to:
> >
> http://git.haproxy.org/?p=haproxy-1.6.git;a=commit;h=6b726adb35d998eb55671c0d98ef889cb9fd64ab
> >
> > I don't understand why it's saner to kill the connection and hide the 504
> > instead of clearly stating the error and let the application handle the
> > timeout.
>
> As explained above, it's because a keep-alive enabled client must implement
> the ability to replay requests for which it didn't get a response because
> the connection died. In fact we're forwarding to the client what we saw on
> the server side so that the client can take the correct decision. If your
> client was directly connected to the server, it would have seen the exact
> same behaviour.
>

That's where it gets confusing. HAProxy treats a server timeout on the
first request and the nth request differently and I don't see why.

There are no semantic differences between a timeout on the first or on the
second request of the keep-alive connection. If I see a 504 when it's the
first request, why don't I see a 504 when it's the second?

>From your explanation, I understand that HAProxy closes the connection
abruptly only to force the client to retry which is either unsafe or not
possible in most cases.
The only solution for the client is to deal with the consequences of a
"remote disconnected" error, which is false and has much less information
than a 504 timeout.

What's even worse is that with `http-server-close`, so that HAProxy uses a
brand new connection with the server, it'll still kills the client
connection instead of "forwarding" what it sees as a timeout.

If my client was directly connected to the server it would have hanged. I
configure haproxy timeout to avoid that and trigger a timeout.


It's not related to RFCs, I know they say almost nothing on keep-alive
connection getting closed.


I'm not advocating having this as the default behavior (even though I think
the current default is wrong and it should be documented), but at least
having this as an option, or include it in http-server-close if it even
makes sense.

Bests

Reply via email to