]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix a race in the Async unit tests 13304/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 28 Sep 2023 12:13:59 +0000 (14:13 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 28 Sep 2023 12:13:59 +0000 (14:13 +0200)
commitf39b15a71271afe6333e55f5994b680a68eeccbd
treefde97630065f955fc3def6fe701c2fad2c9ea209
parent598ddcb064acaf640f1437122461687f80cee053
dnsdist: Fix a race in the Async unit tests

We used to set the `errorRaised` variable from the `AsynchronousHolder`
thread then check its value from the main thread, which is correctly
reported as TSAN as a data race. We do know that we have waited enough,
and that otherwise it's fine to fail, but TSAN cannot know that. Switching
to a `std::atomic<bool>` fixes it.
pdns/dnsdistdist/test-dnsdistasync.cc