chia7712 commented on code in PR #900:
URL: https://github.com/apache/yunikorn-core/pull/900#discussion_r1657086579


##########
pkg/scheduler/partition.go:
##########
@@ -1241,54 +1241,55 @@ func (pc *PartitionContext) 
calculateNodesResourceUsage() map[string][]int {
 
 // removeAllocation removes the referenced allocation(s) from the applications 
and nodes

Review Comment:
   please move this comment to `removeAllocation`



##########
pkg/scheduler/partition.go:
##########
@@ -1241,54 +1241,55 @@ func (pc *PartitionContext) 
calculateNodesResourceUsage() map[string][]int {
 
 // removeAllocation removes the referenced allocation(s) from the applications 
and nodes
 // NOTE: this is a lock free call. It must NOT be called holding the 
PartitionContext lock.
-func (pc *PartitionContext) removeAllocation(release *si.AllocationRelease) 
([]*objects.Allocation, *objects.Allocation) {
-       if release == nil {
-               return nil, nil
-       }
-       appID := release.ApplicationID
-       allocationKey := release.GetAllocationKey()
-       app := pc.getApplication(appID)
-       // no app nothing to do everything should already be clean
-       if app == nil {
-               log.Log(log.SchedPartition).Info("Application not found while 
releasing allocation",
-                       zap.String("appID", appID),
-                       zap.String("allocationKey", allocationKey),
-                       zap.Stringer("terminationType", 
release.TerminationType))
-               return nil, nil
-       }
-       // Processing a removal while in the Completing state could race with 
the state change.
-       // The race occurs between removing the allocation and updating the 
queue after node processing.
-       // If the state change removes the queue link before we get to updating 
the queue after the node we
-       // leave the resources as allocated on the queue. The queue cannot be 
removed yet at this point as
-       // there are still allocations left. So retrieve the queue early to 
sidestep the race.
-       queue := app.GetQueue()
-       // temp store for allocations manipulated
+//
+//nolint:funlen

Review Comment:
   this can be removed now, right?



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

Reply via email to