yangwwei commented on a change in pull request #72: Add ability to support 3rd 
party K8s operator integration
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/72#discussion_r383693816
 
 

 ##########
 File path: pkg/appmgmt/appmgmt_recovery.go
 ##########
 @@ -31,20 +31,24 @@ import (
 
 func (svc *AppManagementService) WaitForRecovery(maxTimeout time.Duration) 
error {
        if !svc.apiProvider.IsTestingMode() {
-               apps := svc.kickoffRecovery()
+               apps, err := svc.recoverApps()
+               if err != nil {
+                       return err
+               }
+
                return svc.waitForAppRecovery(apps, maxTimeout)
        }
        return nil
 }
 
-func (svc *AppManagementService) kickoffRecovery() 
map[string]interfaces.ManagedApp {
+func (svc *AppManagementService) recoverApps() 
(map[string]interfaces.ManagedApp, error) {
        recoveringApps := make(map[string]interfaces.ManagedApp)
        for _, mgr := range svc.managers {
                if m, ok := mgr.(interfaces.Recoverable); ok {
                        appMetas, err := m.ListApplications()
                        if err != nil {
                                log.Logger.Error("failed to list apps", 
zap.Error(err))
-                               return recoveringApps
+                               return recoveringApps, err
                        }
 
 Review comment:
   if any of that failed, the recovery is failed and the scheduler will exit 
with an error. there is no need to continue running the scheduler within a 
consistent state.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to