Skip to content

Commit

Permalink
Node access is done using locked Node copy
Browse files Browse the repository at this point in the history
Fixes #3454

Reliably reproduced the data race before by having a fingerprinter
change the nodes attributes every millisecond and syncing at the same
rate. With fix, did not ever panic.
  • Loading branch information
dadgar committed Oct 27, 2017
1 parent 2464b02 commit 05bb446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ func (c *Client) CollectAllAllocs() error {
func (c *Client) Node() *structs.Node {
c.configLock.RLock()
defer c.configLock.RUnlock()
return c.config.Node
return c.configCopy.Node
}

// StatsReporter exposes the various APIs related resource usage of a Nomad
Expand Down

0 comments on commit 05bb446

Please sign in to comment.