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

Data race in ApplyConfig #763

Merged
merged 1 commit into from
May 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions trace/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ type Config struct {
//
// 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)
}