Data race in ApplyConfig (#763)
Oddly, I could not get the race detector to find this.
diff --git a/trace/config.go b/trace/config.go
index f3df9be..d5473a7 100644
--- a/trace/config.go
+++ b/trace/config.go
@@ -29,12 +29,12 @@
//
// Fields not provided in the given config are going to be preserved.
func ApplyConfig(cfg Config) {
- c := config.Load().(*Config)
+ c := *config.Load().(*Config)
if cfg.DefaultSampler != nil {
c.DefaultSampler = cfg.DefaultSampler
}
if cfg.IDGenerator != nil {
c.IDGenerator = cfg.IDGenerator
}
- config.Store(c)
+ config.Store(&c)
}