From 869723cfbf6d5b928c3b59c844505683200d8613 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Thu, 14 Mar 2024 15:00:00 -0400 Subject: [PATCH] fix race on error member of TaskRunner --- internal/taskrunner/taskrunner.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/taskrunner/taskrunner.go b/internal/taskrunner/taskrunner.go index b5b5c726f9..78a0b66dd7 100644 --- a/internal/taskrunner/taskrunner.go +++ b/internal/taskrunner/taskrunner.go @@ -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 }