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/01/15 18:25:46 UTC

[GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #219: [YUNIKORN-2] gang scheduling shim side implementation

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



##########
File path: pkg/cache/application.go
##########
@@ -273,42 +312,46 @@ func (app *Application) Schedule() {
 			log.Logger().Warn("failed to handle SUBMIT app event",
 				zap.Error(err))
 		}
-	case states.Accepted:
-		ev := NewRunApplicationEvent(app.GetApplicationID())
-		if err := app.handle(ev); err != nil {
-			log.Logger().Warn("failed to handle RUN app event",
-				zap.Error(err))
-		}
+	case states.Reserving:

Review comment:
       Good question. The Accepted part is moved to
   
   ```
   func (app *Application) postAppAccepted(event *fsm.Event) {
   	// if app has taskGroups defined, it goes to the Reserving state before getting to Running
   	var ev events.SchedulingEvent
   	if len(app.taskGroups) != 0 {
   		ev = NewSimpleApplicationEvent(app.applicationID, events.TryReserve)
   		dispatcher.Dispatch(ev)
   	} else {
   		ev = NewRunApplicationEvent(app.applicationID)
   	}
   	dispatcher.Dispatch(ev)
   }
   ```
   
   it checks if an app has taskGroups, if not, directly transit the app to Running state; otherwise it will be going to the Reserving state. This is due to the state machine graph change, see more [this doc](https://docs.google.com/document/d/1P-g4plXIJ9Xybp-jyKySI18P3rkGQPuTutGYhv1LaQ8/edit#heading=h.laq9umr6wnyj).




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