Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1795

Remove the scheduling cycle in the shim

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • shim - kubernetes
    • None


      While debuggin/profiling YUNIKIORN-1724, the necessity of Application.schedule() has come into question. By default, this method is called in every second, to schedule tasks:

      • if the Application state is Reserving, we only schedule placeholders
      • If it is Running, then we schedule everything
      • Two other states are checked (New / Accepted)

      After analyzing the code, some states and the Schedule() method in Application might be removed, simplifying the current code. We can do this for the following reasons:

      1. The task must not be sent to the core immediately, because we have to wait for the application to be accepted. Until that happens, we just keep collecting Task objects.
      2. As soon as an accept comes back, we just go through all tasks that we have and schedule them. We can mark a boolean flag (eg. Application.accepted = true), so that new incoming tasks can be scheduled immediately.
      3. In order to send the request to the core, we just need another extra call after we created the Task. There's no need for the InitTask state.
      4. Inside Task.handleSubmitTaskEvent(), we already have the Application object and know if it's a gang job or not. If it is and the task is not a placeholder, we simply wait for placeholder allocations and don't submit the task.
      5. If a placeholder is allocated, we can always check if it is time for the normal pods to start running in postTaskBound(). We don't need an extra application event for that.

      With this in mind, I suggest removing Application.Schedule() and the InitTask state from Task. This makes the code simpler to understand and probably even faster.



          This comment will be Viewable by All Users Viewable by All Users


            pbacsko Peter Bacsko
            pbacsko Peter Bacsko




                Issue deployment