]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: add random delay injection with "debug dev delay-inj"
authorWilly Tarreau <w@1wt.eu>
Thu, 9 Mar 2023 07:25:01 +0000 (08:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Mar 2023 13:01:58 +0000 (14:01 +0100)
commitbd3b44edff47865d0bf5ccf6d49033f035e673a3
tree3ad65be8ceef9de5f0b92094a70e60d47d598460
parentcd8914bc525668bc4a41278deee3430c69d29500
MINOR: debug: add random delay injection with "debug dev delay-inj"

The goal is to send signals to random threads at random instants so that
they spin for a random delay in a relax() loop, trying to give back the
CPU to another competing hardware thread, in hope that from time to time
this can trigger in critical areas and increase the chances to provoke a
latent concurrency bug. For now none were observed.

For example, this command starts 64 such tasks waking after random delays
of 0-1ms and delivering signals to trigger such loops on 3 random threads:

  for i in {1..64}; do
    socat - /tmp/sock1 <<< "expert-mode on;debug dev delay-inj 2 3"
  done

This command is only enabled when DEBUG_DEV is set at build time.
src/debug.c