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



##########
File path: pkg/cache/application.go
##########
@@ -456,6 +456,29 @@ func (app *Application) 
handleRecoverApplicationEvent(event *fsm.Event) {
        }
 }
 
+func (app *Application) skipReservationStage() bool {
+       // no task groups defined, skip reservation
+       if len(app.taskGroups) == 0 {
+               log.Logger().Debug("Skip reservation stage: no task groups 
defined")
+               return true
+       }
+
+       // if there is any task already passed New state,
+       // that means the scheduler has already tried to schedule it
+       // in this case, we should skip the reservation stage
+       if len(app.taskMap) > 0 {
+               for _, task := range app.taskMap {
+                       if task.GetTaskState() != events.States().Task.New {
+                               log.Logger().Debug("Skip reservation stage: 
found task already has been scheduled before.",
+                                       zap.String("taskID", task.GetTaskID()),

Review comment:
       Make sense, fixed.

##########
File path: pkg/cache/application.go
##########
@@ -456,6 +456,29 @@ func (app *Application) 
handleRecoverApplicationEvent(event *fsm.Event) {
        }
 }
 
+func (app *Application) skipReservationStage() bool {
+       // no task groups defined, skip reservation
+       if len(app.taskGroups) == 0 {
+               log.Logger().Debug("Skip reservation stage: no task groups 
defined")

Review comment:
       Make sense, 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]


Reply via email to