]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: sample_fetches: pin one thread in the connection address test
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2026 03:28:56 +0000 (03:28 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 15:19:30 +0000 (17:19 +0200)
The test asserted that dst_conn reports exactly one connection, which
holds when it runs alone but not when the reg-tests are run in parallel
on a loaded machine: it was reported failing with a value of 8.

The extra connections are not real. With several threads accepting in
parallel, the process ends up reporting current connections which were
never established: after the only client has left, "show info" reports
a non-zero CurrConns while CumConns has only counted the connections
which really happened, and "show stat" shows the same discrepancy
between scur and stot for the frontend. Forcing nbthread to 1 makes the
counters exact again, which is what this test needs since it checks the
address fetches, not the connection accounting.

reg-tests/sample_fetches/conn_addresses.vtc

index 4630f11c42c28f636a1eb22d848ca71f2deb13a6..8841b7e6e72745943c4f452ca589654de7acc9be 100644 (file)
@@ -9,6 +9,12 @@ varnishtest "Test the connection address and multiplexer sample fetches"
 # boolean in case of socket creation failure. This needs to be debugged on
 # that platform.
 
+# A single thread is used because act_conn, fe_conn and dst_conn are
+# over-counted when several threads accept in parallel on a loaded
+# machine: the process then reports current connections which were never
+# established (see "CurrConns" in "show info" vs "CumConns"). That is
+# unrelated to what this test checks.
+
 feature ignore_unknown_macro
 
 server s1 {
@@ -20,6 +26,7 @@ haproxy h1 -conf {
     global
     .if feature(THREAD)
         thread-groups 1
+        nbthread 1
     .endif
         chroot /