]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: http-messaging: make the /c5 abort land during the retries
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2026 22:50:12 +0000 (22:50 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 15:25:37 +0000 (17:25 +0200)
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.

reg-tests/http-messaging/http_abortonclose.vtc

index c5eb1d37c1124cea6250aed5241e0227e56d34fe..21889ad0b52588de1152648bfae97099dba16e33 100644 (file)
@@ -226,6 +226,11 @@ syslog S1 -wait
 # 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