Skip to content

Commit

Permalink
Merge pull request #1801 from ecordell/tr-race
Browse files Browse the repository at this point in the history
Fix race on error member of TaskRunner
  • Loading branch information
josephschorr authored Mar 14, 2024
2 parents 33ae2e5 + 869723c commit 19a320e
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 19a320e

Please sign in to comment.