change read lock to write lock

This commit is contained in:
Travis Turner 2017-11-03 17:43:05 -05:00
parent 73b9d9fd85
commit c7c1be6813
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
2 changed files with 2 additions and 4 deletions

View file

@ -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() {

View file

@ -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