]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix a race in the Async unit tests 13603/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 28 Sep 2023 12:13:59 +0000 (14:13 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Dec 2023 10:49:52 +0000 (11:49 +0100)
commit839f9de07a4aff0cb6f803772f0b2a6bd482de0f
tree31dced9f1e8fd99ea61a0a951cfb9d805bed04ee
parent53a3c7e1ca5f3d1b38a04309f7f210837b51f536
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.

(cherry picked from commit f39b15a71271afe6333e55f5994b680a68eeccbd)
pdns/dnsdistdist/test-dnsdistasync.cc