Skip to content

Fix tasks getting stuck in Pending#2998

Merged
dperny merged 1 commit into
moby:masterfrom
dperny:fix-stalled-scheduler-tasks
Feb 11, 2021
Merged

Fix tasks getting stuck in Pending#2998
dperny merged 1 commit into
moby:masterfrom
dperny:fix-stalled-scheduler-tasks

Conversation

@dperny

@dperny dperny commented Feb 9, 2021

Copy link
Copy Markdown
Collaborator

- What I did

Fixed a bug where tasks could get stuck in the Pending state if there was no suitable node for the task.

- How I did it

When a task could not be scheduled, because of something like MaxReplicas (or, in my testing of it, the WIP Swarm Cluster Volumes functionality), it would stay in the Pending state forever, unable to progress but never shut down.

This change makes it so that if a Task has no suitable node, belongs to an older revision of the service, and is desired to be Shutdown, then the Scheduler takes initiative to move it to state Shutdown.

This is permissible because when the Task is in state Pending, it's lifecycle is under the purview of the scheduler.

- How to test it

Includes a new automated test. This test failed before the change, and succeeds now.

- Description for the changelog

Fixed a bug where tasks which could not be scheduled stayed in the Pending state forever.

Fixed a bug where tasks could get stuck in the Pending state if there
was no suitable node for the task.

Signed-off-by: Drew Erny <[email protected]>
@dperny
dperny force-pushed the fix-stalled-scheduler-tasks branch from 6834e7b to 807f25e Compare February 11, 2021 17:09
@codecov

codecov Bot commented Feb 11, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2998 (807f25e) into master (d6592dd) will decrease coverage by 1.68%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2998      +/-   ##
==========================================
- Coverage   61.77%   60.08%   -1.69%     
==========================================
  Files         142      142              
  Lines       23005    20454    -2551     
==========================================
- Hits        14211    12290    -1921     
+ Misses       7303     6693     -610     
+ Partials     1491     1471      -20     

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant