]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: fix a 100% cpu usage with cpu-map and nbthread/nbproc
authorCyril Bonté <cyril.bonte@free.fr>
Mon, 12 Mar 2018 20:47:39 +0000 (21:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Mar 2018 21:52:24 +0000 (22:52 +0100)
commitd400ab3a369523538c426cb70e059954c76b69c3
tree6cd75f102fa65ca9159577e6dba49115c6459c8a
parentb53e20826e8e12a74a73634e7986a06e3c712deb
BUG/MEDIUM: fix a 100% cpu usage with cpu-map and nbthread/nbproc

Krishna Kumar reported a 100% cpu usage with a configuration using
cpu-map and a high number of threads,

Indeed, this minimal configuration to reproduce the issue :
  global
    nbthread 40
    cpu-map auto:1/1-40 0-39

  frontend test
    bind :8000

This is due to a wrong type in a shift operator (int vs unsigned long int),
causing an endless loop while applying the cpu affinity on threads. The same
issue may also occur with nbproc under FreeBSD. This commit addresses both
cases.

This patch must be backported to 1.8.
src/haproxy.c