Skip to content

swarm: ignore completed job tasks in constraint enforcer - #52715

Closed
lohitkolluri wants to merge 1 commit into
moby:masterfrom
lohitkolluri:lk/swarm-constraint-enforcer-jobs
Closed

lohitkolluri wants to merge 1 commit into
moby:masterfrom
lohitkolluri:lk/swarm-constraint-enforcer-jobs

Conversation

@lohitkolluri

Copy link
Copy Markdown
Contributor

Summary

  • Fix Swarm 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

  • make build
  • docker run ... /usr/local/go/bin/go test ./vendor/github.com/moby/swarmkit/v2/manager/orchestrator/constraintenforcer -count=1

Fixes #52652

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is modifying files vendored from https://github.com/moby/swarmkit and should be fixed there.

@lohitkolluri

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for catching that. Since this touches vendored moby/swarmkit code, I’ll move the fix and regression test upstream to moby/swarmkit first.

Once that is merged, I’ll update Moby through the usual vendor sync workflow and refresh this PR accordingly (or replace it entirely if that’s preferred).

@lohitkolluri

lohitkolluri commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Sync update: the actual fix is now proposed upstream in moby/swarmkit#3237.
This PR will be updated to only pull that upstream change into Moby once it’s merged, using the normal dependency update flow. Keeping all functional changes in swarmkit avoids duplicate patches here.

@lohitkolluri

Copy link
Copy Markdown
Contributor Author

@thaJeztah would you mind taking a look at this upstream PR? If it helps coordination, feel free to assign yourself as reviewer.

@lohitkolluri

Copy link
Copy Markdown
Contributor Author

Hey Quick follow-up: Drew has approved the upstream PR (moby/swarmkit#3237). Should I keep this PR open pending the upstream merge and vendor sync, or would you prefer I close it and submit a new PR once the dependency update is ready?

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Constraint enforcer counts completed ReplicatedJob tasks against node memory

2 participants