Skip to content

Commit

Permalink
fix race on error member of TaskRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Mar 14, 2024
1 parent 33ae2e5 commit 869723c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/taskrunner/taskrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,8 @@ func (tr *TaskRunner) emptyForCancel() {
// or the parent context to have been canceled.
func (tr *TaskRunner) Wait() error {
tr.wg.Wait()

tr.lock.Lock()
defer tr.lock.Unlock()
return tr.err
}

0 comments on commit 869723c

Please sign in to comment.