yangwwei commented on a change in pull request #151:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/151#discussion_r427624139



##########
File path: pkg/scheduler/scheduler.go
##########
@@ -315,9 +318,24 @@ func (s *Scheduler) processAllocationUpdateEvent(ev 
*schedulerevent.SchedulerAll
        if len(ev.AcceptedAllocations) > 0 {
                alloc := ev.AcceptedAllocations[0]
                // Update pending resource
-               if err := s.confirmAllocationProposal(alloc); err != nil {
+               if err := 
s.confirmAllocationProposal(alloc.AllocationProposal); err != nil {
                        log.Logger().Error("failed to confirm allocation 
proposal",
                                zap.Error(err))
+                       // if the scheduler could not confirm the proposal,
+                       // we need to notify the cache to revert the allocations
+                       for _, allocInfo := range alloc.Allocations {
+                               
s.eventHandlers.CacheEventHandler.HandleEvent(&cacheevent.ReleaseAllocationsEvent{

Review comment:
       Currently, shim has no action to take for released allocations.
   But this makes sense, it's better to add another `ReleaseType` in the 
scheduler-interface for this case, 
maybe`AllocationReleaseResponse_REJECTED_BY_SCHEDULER `? We can track this 
enhancement in a separate JIRA.




----------------------------------------------------------------
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:
[email protected]


Reply via email to