mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Work around flow trace's data race bug (#7237)
* Work around flow trace's data race bug BaseTraceEvent::setNetworkThread() and flushTraceFile[()|Void()] has a long-standing race condition for traceEventThrottlerCache global when flushTraceFileVoid() is not called from the network thread. This race dates back to 2017 (commit hash 80e5fecfe2), so before the race itself is fixed, work around the problem. * Remove call to flushTraceFileVoid() from MkCertCli * Apply clang format
This commit is contained in:
parent
ddbecb69ad
commit
ed91ab5d54
@ -278,14 +278,11 @@ int main(int argc, char** argv) {
|
||||
Error::init();
|
||||
g_network = newNet2(TLSConfig());
|
||||
openTraceFile(NetworkAddress(), 10 << 20, 10 << 20, ".", "mkcert");
|
||||
auto thread = std::thread([]() {
|
||||
TraceEvent::setNetworkThread();
|
||||
g_network->run();
|
||||
});
|
||||
auto thread = std::thread([]() { g_network->run(); });
|
||||
auto cleanUpGuard = ScopeExit([&thread]() {
|
||||
flushTraceFileVoid();
|
||||
g_network->stop();
|
||||
thread.join();
|
||||
closeTraceFile();
|
||||
});
|
||||
|
||||
serverArgs.transformPathToAbs();
|
||||
|
Loading…
x
Reference in New Issue
Block a user