Skip to content

Commit

Permalink
fix race condition in meta client
Browse files Browse the repository at this point in the history
  • Loading branch information
chengshiwen committed Aug 29, 2024
1 parent 5af74de commit 745b7ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/meta/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ func (c *Client) Close() error {
}

// NodeID returns the client's node ID.
func (c *Client) NodeID() uint64 { return c.nodeID }
func (c *Client) NodeID() uint64 {
c.mu.RLock()
defer c.mu.RUnlock()
return c.nodeID
}

// SetMetaServers updates the meta servers on the client.
func (c *Client) SetMetaServers(a []string) {
Expand Down

0 comments on commit 745b7ee

Please sign in to comment.