Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: moby/swarmkit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8c19597
Choose a base ref
...
head repository: moby/swarmkit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a45be3c
Choose a head ref
  • 2 commits
  • 3 files changed
  • 3 contributors

Commits on May 28, 2025

  1. manager: fix task scheduler infinite loop

    If the running tasks for a service are not well balanced across the
    placement-preference tree, the task scheduler could enter an infinite
    loop when scaling the service up. The scheduleNTasksOnSubtree loop
    terminates when either all tasks have been scheduled onto nodes, or the
    nodes in all subtrees are out of room to accept new tasks. The trouble
    is that the algorithm only considers a subtree to be out of room if an
    attempt was made to schedule tasks onto its nodes but not all tasks were
    scheduled. Subtrees with more tasks already running than the desired
    number of tasks for a balanced tree are skipped over without attempting
    to assign any tasks, so do not have a chance to be considered out of
    room. The scheduler will therefore enter a tight infinite loop when
    there exists a node of the placement-preferences tree in which at least
    one subtree has more tasks running than desired, and all other subtrees
    are out of room for more tasks.
    
    It would be incorrect to consider a subtree as out of room just because
    there are more tasks running than desired at a particular iteration of
    the scheduling loop. The desired number of tasks to assign changes as
    the scheduler iteratively schedules tasks and other subtrees run out of
    room, so it is possible for a subtree to become eligible in a future
    iteration.
    
    Add a third condition to the task scheduler loop. Make it so the loop
    exits if there are no subtrees which are eligible for task scheduling,
    whether due to being out of room or have more tasks running than
    desired.
    
    Co-authored-by: Xinfeng Liu <[email protected]>
    Signed-off-by: Cory Snider <[email protected]>
    corhere and xinfengliu committed May 28, 2025
    Configuration menu
    Copy the full SHA
    2d6aff7 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2025

  1. Merge pull request #3200 from corhere/fix-scheduler-placementpref-inf…

    …inite-loop
    
    manager: fix task scheduler infinite loop
    dperny authored Jun 13, 2025
    2 Configuration menu
    Copy the full SHA
    a45be3c View commit details
    Browse the repository at this point in the history
Loading