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



##########
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:
       I don't suggest to change scheduler interface for the purpose. 
scheduler-interface is supposed to be used for communication between core and 
shim, not within the shim. 
   
   Or we can add a field to indicate the allocation is a "transient allocation" 
so cache can find there's no need to send the information back to RMProxy.
   
   I think it is fine to have a separate JIRA because notifying RM about the 
extra released resource should be fine. But let's fix it by 0.9 release (mark 
priority to be blocker).




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