BUG/MEDIUM: threads: unbreak "bind" referencing an incorrect thread number
authorWilly Tarreau <w@1wt.eu>
Fri, 27 Jul 2018 16:07:41 +0000 (18:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 30 Jul 2018 09:10:46 +0000 (11:10 +0200)
commitc477b6fcc91c382f7edc2caca692c4059487cd6f
treef4cda33180389cf3bcbab739112bd47635205962
parent0ccd32285fbe8a1a394f7b8fb9f7e6282ec9a32d
BUG/MEDIUM: threads: unbreak "bind" referencing an incorrect thread number

The "process" directive on "bind" lines supports process references and
thread references. No check is performed on the thread number validity,
so that if a listener is only bound to non-existent threads, the traffic
will never be processed. It easily happens when setting one bind line per
thread with an incorrect (or reduced) thread count. No warning appears
and some random connections are never served. It also happens when setting
thread references with threads support disabled at build time.

This patch makes use of the all_threads_mask variable to detect if some
referenced threads don't exist, to emit a warning and fix this.

This patch needs to be backported to 1.8, just like the previous one which
it depends on (MINOR: threads: move "nbthread" parsing to hathreads.c).
src/cfgparse.c