Skip to content

scheduler: Tasks with a desired state < RUNNING should count#1980

Merged
aluzzardi merged 1 commit intomoby:masterfrom
aaronlehmann:bad-scheduling-decisions-parallel-update
Feb 23, 2017
Merged

scheduler: Tasks with a desired state < RUNNING should count#1980
aluzzardi merged 1 commit intomoby:masterfrom
aaronlehmann:bad-scheduling-decisions-parallel-update

Conversation

@aaronlehmann
Copy link
Collaborator

Currently, the scheduler counts tasks on each node with desired state of
RUNNING. This works fine for sequential updates, but in parallel
updates, the scheduler can assign tasks unfairly, because the ones it
already assigned may not have changed their desired state to RUNNING
yet. In an update with unlimited parallelism, all the tasks may end up
on the same node, even when there are multiple nodes that can accomodate
the tasks.

Fix this by considering all tasks with a desired state at or below
RUNNING to be active. For example, tasks at READY should be seen the
same way as RUNNING tasks by the scheduler - they were assigned to that
node and will eventually start running.

cc @jlhawn @aluzzardi @dongluochen

Currently, the scheduler counts tasks on each node with desired state of
RUNNING. This works fine for sequential updates, but in parallel
updates, the scheduler can assign tasks unfairly, because the ones it
already assigned may not have changed their desired state to RUNNING
yet. In an update with unlimited parallelism, all the tasks may end up
on the same node, even when there are multiple nodes that can accomodate
the tasks.

Fix this by considering all tasks with a desired state at or below
RUNNING to be active. For example, tasks at READY should be seen the
same way as RUNNING tasks by the scheduler - they were assigned to that
node and will eventually start running.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@codecov-io
Copy link

Codecov Report

Merging #1980 into master will decrease coverage by -0.11%.
The diff coverage is 72.72%.

@@            Coverage Diff             @@
##           master    #1980      +/-   ##
==========================================
- Coverage   53.69%   53.59%   -0.11%     
==========================================
  Files         109      109              
  Lines       18919    18919              
==========================================
- Hits        10158    10139      -19     
- Misses       7526     7543      +17     
- Partials     1235     1237       +2

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4dbc0a3...69bd653. Read the comment docs.

@dongluochen
Copy link
Contributor

LGTM

@aluzzardi
Copy link
Member

LGTM

Cherry pick?

@aluzzardi aluzzardi merged commit d29a857 into moby:master Feb 23, 2017
@aaronlehmann aaronlehmann deleted the bad-scheduling-decisions-parallel-update branch February 23, 2017 18:51
@aaronlehmann
Copy link
Collaborator Author

Cherry picked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants