You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/05/26 04:46:37 UTC

[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #267: [YUNIKORN-686] [Regression] Placeholders for completed applications are recreated during recovery

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:
users@infra.apache.org