yangwwei commented on a change in pull request #267:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/267#discussion_r639397260
##########
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.",
Review comment:
This is correct, but I think this should be fine.
--
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]