Call getTraceThreadId() before we enable allocation tracing (#7888)
This commit is contained in:
parent
e705b055b0
commit
3a53ec3115
|
@ -1286,6 +1286,10 @@ thread_local bool BaseTraceEvent::networkThread = false;
|
|||
void BaseTraceEvent::setNetworkThread() {
|
||||
if (!networkThread) {
|
||||
if (FLOW_KNOBS->ALLOCATION_TRACING_ENABLED) {
|
||||
// Ensure that threadId is initialized before we enable allocation tracing, otherwise it would
|
||||
// be initialized either by first normal usage of TraceEvent or by allocation tracing which is
|
||||
// non-deterministic, and we could run into https://github.com/apple/foundationdb/issues/7872.
|
||||
getTraceThreadId();
|
||||
--g_allocation_tracing_disabled;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue