Willy,
On 5/21/21 6:48 PM, Willy Tarreau wrote:
I'd like your advice on a few log entries that confuse me. I am seeing HTTP
2.0 requests dying with a termination code of 'CC', i.e.:
C : the TCP session was unexpectedly aborted by the client.
C : the proxy was waiting for the CONNECTION to establish on the
server. The server might at most have noticed a connection attempt.
Thus my understanding is that the client is "simply gone". However HAProxy
*also logs* a HTTP status of 503 with 0 bytes sent to the client.
For requests that never even established a connection to the server and that
were aborted by the client I would not have expected any status code to be
logged at all, after all the server could not generate one and there is no
client that would be able to receive it.
I'd say "it depends". If a connection attempt was made, and your servers
are flooded with aborted connections coming from haproxy, I'm pretty sure
you'll come here and ask why haproxy doesn't produce a log that permits
to identify the client and frontend involved in this.
Yes, it absolutely makes sense that this connection attempt is logged in
HAProxy. It's just that the status code I disagree with.
The 503 is just a byproduct of the aborted connection. That can sound
strange but what happens here is that the status was set after it was
noticed the processing ended without being able to connect to any server.
I agree that a 4xx would be more suitable here, and this problem was
already raised in the past regarding the fact that *certain* aborts or
errors need closer inspection to figure where the problem was.
I believe in some cases a status code of 0 (zero) or -1 is logged, but
I'm not 100% sure there. I would consider such a status to be
appropriate as well, because no HTTP response was actually sent to the
client.
We've already noted that significant improvements in close/abort need to
be made to 1) process them better and 2) report them more accurately.
This is a tedious task which *will* inevitably cause regressions, but
it's the price to pay to improve that.
Shall I file a feature request on GitHub that the 'CC' case does not
result in a 5xx, but a 4xx or something clearly invalid?
For the time being, status codes are here for a reason and are more
s/status/termination/?
accurate than a status code (status which could also come from a server
by the way). There used to be some corner cases of combined client+server
errors reporting server errors, but these faded away with the muxes and
I don't think there are still any (or only in tricky cases). Thus I'd
encourage you to check the termination flags to be certain.
ack, thank you.
Best regards
Tim Düsterhus
Developer WoltLab GmbH
--
WoltLab GmbH
Nedlitzer Str. 27B
14469 Potsdam
Tel.: +49 331 96784338
[email protected]
www.woltlab.com
Managing director:
Marcel Werk
AG Potsdam HRB 26795 P