yangwwei commented on a change in pull request #244:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/244#discussion_r597254715



##########
File path: pkg/callback/scheduler_callback.go
##########
@@ -88,6 +88,27 @@ func (callback *AsyncRMCallback) RecvUpdateResponse(response 
*si.UpdateResponse)
                }
        }
 
+       // handle status changes
+       for _, updated := range response.UpdatedApplications {
+               log.Logger().Debug("status update callback received",
+                       zap.String("appId", updated.ApplicationID),
+                       zap.String("new status", updated.State))
+               // delete application from context
+               if updated.State == events.States().Application.Completed {
+                       err := 
callback.context.RemoveApplicationInternal(updated.ApplicationID)
+                       if err != nil {
+                               log.Logger().Error("failed to delete 
application", zap.Error(err))
+                       }
+               } else {
+                       if updated.State == "Failing" || updated.State == 
events.States().Application.Failed {

Review comment:
       Got it, but I think we need to introduce the Failing state in the shim 
side as well to keep it in sync with the core side state. We need to follow 
that up in YUNIKORN-585. It doesn't seem good to handle 
ReleaseAppAllocation/ask event in Failed state, which is quite weird. Lets get 
this fixed in YUNIKORN-585. thanks




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