From c7c1be6813e006cc5d85a748869022fb0781debe Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Fri, 3 Nov 2017 17:43:05 -0500 Subject: [PATCH] change read lock to write lock --- cluster.go | 4 +--- test/cluster.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cluster.go b/cluster.go index c438c5f7e..323283a8a 100644 --- a/cluster.go +++ b/cluster.go @@ -901,9 +901,7 @@ func (j *ResizeJob) setState(state string) { // Run distributes ResizeInstructions. func (j *ResizeJob) Run() error { // Set job state to RUNNING. - j.mu.RLock() - j.setState(ResizeJobStateRunning) - j.mu.RUnlock() + j.SetState(ResizeJobStateRunning) // Job can be considered done in the case where it doesn't require any action. if !j.urisArePending() { diff --git a/test/cluster.go b/test/cluster.go index 9d887acce..e73289827 100644 --- a/test/cluster.go +++ b/test/cluster.go @@ -160,7 +160,7 @@ func (t *TestCluster) AddNode(saveTopology bool) error { return err } - // Wait for the NodeAdd job to finish. + // Wait for the AddNode job to finish. if c.State != pilosa.ClusterStateNormal { t.resizeDone = make(chan struct{}) <-t.resizeDone