BUG/MEDIUM: server: extend thread-isolate over much of CLI 'add server'
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 10 Jun 2021 13:26:44 +0000 (15:26 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Jun 2021 09:19:43 +0000 (11:19 +0200)
commit31ddd76fef720c35c22acc39016feea5604e5b39
tree39b5c4b40f0e5d6e4e5d01183cc208fd17c60770
parent077c6b8d29ba63a625648ebb73bf151a793f0096
BUG/MEDIUM: server: extend thread-isolate over much of CLI 'add server'

Some config parsing handlers were designed to be run at startup on a
single-thread. When executing at runtime for dynamic servers,
thread-safety is not guaranteed. This is the case for example in
srv_parse_id which manipulates backend used_ids tree.

One solution could be to add locks but it might be tricky to found all
affected functions and it can be an easy source of deadlock. The other
solution which has been chosen is to use thread-isolation over almost
all of the cli_parse_add_server CLI handler.

For now this solution is sufficient. If some users make heavy use of the
'add server', hurting the overall performance, it will be necessary to
design a much thinner solution.

This must be backported up to 2.4.
src/server.c