Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit c3ed530

Browse files
author
Ramon Nogueira
authored
Data race in ApplyConfig (#763)
Oddly, I could not get the race detector to find this.
1 parent a658407 commit c3ed530

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

trace/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type Config struct {
2929
//
3030
// Fields not provided in the given config are going to be preserved.
3131
func ApplyConfig(cfg Config) {
32-
c := config.Load().(*Config)
32+
c := *config.Load().(*Config)
3333
if cfg.DefaultSampler != nil {
3434
c.DefaultSampler = cfg.DefaultSampler
3535
}
3636
if cfg.IDGenerator != nil {
3737
c.IDGenerator = cfg.IDGenerator
3838
}
39-
config.Store(c)
39+
config.Store(&c)
4040
}

0 commit comments

Comments
 (0)