The previous attempt at making this case robust, which raised the
connect timeout so that the client abort is noticed before the retries
are over, was not enough: the client closes immediately after its
request, so under load the close is sometimes seen while the request is
still being parsed, and the transaction is then logged as "CH--" with a
400 instead of the expected "CC--".
The client now waits fifty milliseconds before closing, which leaves
haproxy the time to read the request and to start connecting, and the
raised connect timeout gives the abort a full second to be noticed.
Twenty runs in parallel with the machine loaded pass.
# abortonclose on backend only
client c5 -connect ${h2_fe1_sock} {
txreq -url /c5
+ # leave haproxy the time to read the request and to start connecting,
+ # otherwise the close may be seen while the request is still being
+ # parsed, which is reported as a client abort during the headers and
+ # not during the connection retries
+ delay 0.05
} -run
# Wait c5 log entry