diff --git a/pkg/workceptor/workunitbase.go b/pkg/workceptor/workunitbase.go index cc570cb5d..0faa481f3 100644 --- a/pkg/workceptor/workunitbase.go +++ b/pkg/workceptor/workunitbase.go @@ -251,6 +251,8 @@ func (sfd *StatusFileData) UpdateFullStatus(filename string, statusFunc func(*St // UpdateFullStatus atomically updates the whole status record. Changes should be made in the callback function. // Errors are logged rather than returned. func (bwu *BaseWorkUnit) UpdateFullStatus(statusFunc func(*StatusFileData)) { + bwu.statusLock.Lock() + defer bwu.statusLock.Unlock() err := bwu.status.UpdateFullStatus(bwu.statusFileName, statusFunc) bwu.lastUpdateError = err if err != nil {