craigcondit commented on code in PR #853:
URL: https://github.com/apache/yunikorn-core/pull/853#discussion_r1575426728
##########
pkg/scheduler/partition.go:
##########
@@ -608,7 +608,7 @@ func (pc *PartitionContext) addNodeResources(node
*objects.Node) {
if pc.totalPartitionResource == nil {
pc.totalPartitionResource = node.GetCapacity().Clone()
} else {
- pc.totalPartitionResource.AddTo(node.GetCapacity())
Review Comment:
I think in this case, the mutation is happening under lock within
updatePartitionResource(), which is fine. Instead, we should add Clone() to
GetTotalPartitionResource(). We should never return a mutable reference from
that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]