You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/01/28 22:40:15 UTC

[GitHub] [incubator-yunikorn-core] wilfred-s commented on a change in pull request #242: [YUNIKORN-461] remove allocations list from partition

wilfred-s commented on a change in pull request #242:
URL: https://github.com/apache/incubator-yunikorn-core/pull/242#discussion_r566456397



##########
File path: pkg/scheduler/partition.go
##########
@@ -1051,7 +1022,9 @@ func (pc *PartitionContext) addAllocation(alloc *objects.Allocation) error {
 	node.AddAllocation(alloc)
 	app.RecoverAllocationAsk(alloc.Ask)
 	app.AddAllocation(alloc)
-	pc.allocations[alloc.UUID] = alloc
+
+	// track the number of allocations
+	pc.allocations += 1

Review comment:
       Yes, `updateAllocationCount()` is a locked call. The point we are at already has a lock on the partition. We cannot lock and introducing a function to update that does not take a lock is extra overhead we do not need.
   That is the case for all points we do a direct update on the counter.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org