Merge branch 'master' into 1805-rows-call-format

This commit is contained in:
Yuce Tekol 2019-01-21 18:35:05 +03:00
commit b898460a18
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573

View file

@ -609,8 +609,8 @@ func (c *cluster) addNodeBasicSorted(node *Node) bool {
// Nodes returns a copy of the slice of nodes in the cluster. Safe for
// concurrent use, result may be modified.
func (c *cluster) Nodes() []*Node {
c.mu.Lock()
defer c.mu.Unlock()
c.mu.RLock()
defer c.mu.RUnlock()
ret := make([]*Node, len(c.nodes))
copy(ret, c.nodes)
return ret