chore(compose): orphan semantics stated where up and down diverge - #14142
Open
ndeloof wants to merge 1 commit into
Open
chore(compose): orphan semantics stated where up and down diverge#14142ndeloof wants to merge 1 commit into
ndeloof wants to merge 1 commit into
Conversation
39 tasks
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
🟢 No issues found — LGTM! View logs.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ndeloof
force-pushed
the
legible-orphans
branch
from
August 27, 2026 12:44
ae01876 to
1121cc2
Compare
ndeloof
force-pushed
the
legible-orphans
branch
from
August 27, 2026 12:51
1121cc2 to
bff1117
Compare
A container is orphaned when it is a one-off (compose run) that FINISHED its task, or when it carries the project labels but its service is not defined by the compose model — the typical leftover after the compose file was edited. A still-RUNNING one-off is somebody's live session: 'up --remove-orphans' cleans up leftovers and must never kill it. 'down --remove-orphans' is the explicit stop-the-application action, so it DOES take running one-offs down — through the per-service removal loop, not the orphan branch. That asymmetry was implemented but stated nowhere: isOrphaned's comment only mentioned the model-absent half, down.go removed running one-offs as an unexplained side effect of including one-offs in the listing, and the observed-state collection silently dropped running one-offs with no hint it was deliberate. No behavior change — the semantics are now written at all three sites and pinned by tests: the predicate matrix, the observed-state classification (a running one-off is neither a service replica nor an orphan), and down's single stop+remove path for a running one-off of a declared service. Closes item C.4 of docker#14074. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
ndeloof
force-pushed
the
legible-orphans
branch
from
August 27, 2026 12:59
bff1117 to
7dcf422
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Epic #14074, item C.4. The orphan-container asymmetry between
upanddownis intentional but was stated nowhere — this PR writes it down and pins it with tests, with no behavior change:compose run) that finished its task, or when it carries the project labels but its service is not defined by the compose model (the typical leftover after the compose file was edited);up --remove-orphanscleans up leftovers and never kills it (it is deliberately absent from the observed state);down --remove-orphansis the explicit stop-the-application action: it does take running one-offs down, through the per-service removal loop — now said explicitly indown.goinstead of being an unexplained side effect of the container listing.Tests pin the predicate matrix, the observed-state classification (a running one-off is neither a service replica nor an orphan) and down's single stop+remove path for a running one-off of a declared service.
Related issue
Item C.4 of #14074
🤖 Generated with Claude Code