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_r383689133
 
 

 ##########
 File path: pkg/shim/scheduler.go
 ##########
 @@ -152,20 +160,42 @@ func (ss *KubernetesShim) recoverSchedulerState() func(e 
*fsm.Event) {
                // do not block main thread
                go func() {
                        log.Logger.Info("recovering scheduler states")
-                       // wait for recovery, max timeout 3 minutes
-                       if err := ss.context.WaitForRecovery(3 * time.Minute); 
err != nil {
+                       // step 1: recover all applications
+                       // this step, we collect all the existing allocated 
pods from api-server,
+                       // identify the scheduling identity (aka 
applicationInfo) from the pod,
+                       // and then add these applications to the scheduler.
+                       if err := ss.appManager.WaitForRecovery(3 * 
time.Minute); err != nil {
                                // failed
                                log.Logger.Fatal("scheduler recovery failed", 
zap.Error(err))
                                dispatcher.Dispatch(ShimSchedulerEvent{
                                        event: events.RecoverSchedulerFailed,
                                })
-                       } else {
-                               // success
-                               log.Logger.Info("scheduler recovery succeed")
+                       }
+
+                       // step 2: recover existing allocations
+                       // this step, we collect all existing allocations 
(allocated pods) from api-server,
+                       // rerun the scheduling for these allocations in order 
to restore scheduler-state,
+                       // the rerun is like a replay, not a actual scheduling 
procedure.
+                       recoverableApps := make([]interfaces.Recoverable, 0)
 
 Review comment:
   fixed

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