open-telemetry / opentelemetry-go-contrib

Collection of extensions for OpenTelemetry-Go.
https://opentelemetry.io/
Apache License 2.0
1.15k stars 545 forks source link

Fix and detect race condition in clienttrace.go #5700

Open gregorynisbet-google opened 4 months ago

gregorynisbet-google commented 4 months ago

ct.root can be updated without holding the mutex on ct. Also, addEvent can be called on a nil ct.root.

Fix both of these issues by moving the mutex acquisition logic so that ct.root is only touched while the mutex is held.

linux-foundation-easycla[bot] commented 4 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

gregorynisbet-google commented 3 months ago

Friendly ping.