Skip to content

constraintenforcer: ignore completed tasks in reservation accounting#3237

Merged
thaJeztah merged 1 commit into
moby:masterfrom
lohitkolluri:lk/constraint-enforcer-ignore-completed-jobs
Jun 8, 2026
Merged

constraintenforcer: ignore completed tasks in reservation accounting#3237
thaJeztah merged 1 commit into
moby:masterfrom
lohitkolluri:lk/constraint-enforcer-ignore-completed-jobs

Conversation

@lohitkolluri
Copy link
Copy Markdown
Contributor

@lohitkolluri lohitkolluri commented May 28, 2026

Summary

  • Fix constraint enforcer reservation accounting to ignore tasks that are already completed.
  • Prevents completed replicated-job task history from consuming node capacity and causing false rejections.

Test plan

  • go test ./manager/orchestrator/constraintenforcer -count=1

addresses moby/moby#52652

Completed tasks (especially from replicated-job history) should not consume node reservations in the constraint enforcer.

Add a regression test covering completed job tasks.

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
@lohitkolluri
Copy link
Copy Markdown
Contributor Author

lohitkolluri commented May 28, 2026

Quick sync note: this change is the upstream fix for the behavior reported in moby/moby#52652.
Once this is merged, I’ll follow up in moby/moby with the corresponding dependency update so the fix lands in Docker Engine.

@thaJeztah
Copy link
Copy Markdown
Member

@dperny care to have a look?

@lohitkolluri
Copy link
Copy Markdown
Contributor Author

@dperny Can you check it out and drop suggestions if any?

@lohitkolluri
Copy link
Copy Markdown
Contributor Author

Hey just following up on this.

@lohitkolluri
Copy link
Copy Markdown
Contributor Author

Thanks for taking a look and for the approval!

Just checking if there's anything else needed from my side before this can be merged. Happy to make any additional changes if required.

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 20a8f46 into moby:master Jun 8, 2026
9 checks passed
lohitkolluri added a commit to lohitkolluri/moby that referenced this pull request Jun 8, 2026
Update swarmkit to latest master to include the upstream fix for
constraint enforcer counting completed replicated-job tasks against
node capacity (moby/swarmkit#3237).

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
lohitkolluri added a commit to lohitkolluri/moby that referenced this pull request Jun 8, 2026
Update swarmkit to latest master to include the upstream fix for
constraint enforcer counting completed replicated-job tasks against
node capacity (moby/swarmkit#3237).

Fixes moby#52652

Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
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.

3 participants