Skip to content

Commit

Permalink
Make sure to clone metadata in LR before changing
Browse files Browse the repository at this point in the history
This hit the race detector
  • Loading branch information
josephschorr committed Dec 8, 2023
1 parent 90be4e6 commit 3ffaec7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/graph/checkingresourcestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,10 @@ func (crs *checkingResourceStream) runProcess(alwaysProcess bool) (bool, error)
func (crs *checkingResourceStream) addSkippedDispatchCountToBePublished(metadata *v1.ResponseMeta) *v1.ResponseMeta {
dispatchCount := crs.dispatchesToBeReported.Swap(0)
cachedDispatchCount := crs.cachedDispatchesToBeReported.Swap(0)
metadata.DispatchCount += dispatchCount
metadata.CachedDispatchCount += cachedDispatchCount
return metadata
cloned := metadata.CloneVT()
cloned.DispatchCount += dispatchCount
cloned.CachedDispatchCount += cachedDispatchCount
return cloned
}

// spawnIfAvailable spawns a processing working, if the concurrency limit has not been reached.
Expand Down

0 comments on commit 3ffaec7

Please sign in to comment.