Przeglądaj źródła

Acquire exclusive lock when updating (#1025)

Dhruva Krishnamurthy 8 lat temu
rodzic
commit
d9815cdf0f
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      ring.go

+ 2 - 2
ring.go

@@ -142,8 +142,8 @@ type clusterMetadata struct {
 }
 
 func (c *clusterMetadata) setPartitioner(partitioner string) {
-	c.mu.RLock()
-	defer c.mu.RUnlock()
+	c.mu.Lock()
+	defer c.mu.Unlock()
 
 	if c.partitioner != partitioner {
 		// TODO: update other things now