Commit cebcc418 authored by David Vorick's avatar David Vorick

fix a race condition in the renter

parent 6abc5701
......@@ -187,7 +187,9 @@ func (r *Renter) managedRepairIteration(rs *repairState) {
return
case file := <-r.newRepairs:
// TODO: This seems to be happening out of lock, investigate.
id := r.mu.Lock()
r.addFileToRepairState(rs, file)
r.mu.Unlock(id)
return
}
}
......@@ -407,7 +409,9 @@ func (r *Renter) managedWaitOnRepairWork(rs *repairState) {
select {
case finishedUpload = <-rs.resultChan:
case file := <-r.newRepairs:
id := r.mu.Lock()
r.addFileToRepairState(rs, file)
r.mu.Unlock(id)
return
case <-r.tg.StopChan():
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment