fix: ignore one-off container events in up monitor - #14038
Merged
Conversation
`up --abort-on-container-exit` tore down the project when a one-off container created by `docker compose run` exited. The container list built in monitor.Start already excludes one-off containers via oneOffFilter(false), but the event subscription did not, and the only guard on incoming events is the service label, which a one-off container inherits from the service it was run from. Regression since v2.39.0 (last unaffected release is v2.38.2), and a recurrence of docker-archive/compose-cli#1955, fixed there by docker-archive/compose-cli#1987. Signed-off-by: Branislav Osif <brano@osif.digital>
ndeloof
approved these changes
Aug 12, 2026
ndeloof
left a comment
Contributor
There was a problem hiding this comment.
Verified locally: TestCascadeIgnoresOneOffContainer fails against a main build (Aborting on container exit... triggered by the one-off) and the whole TestCascade* family passes with this branch. The monitor.go change is byte-identical to the already-approved #14021, now with the sign-off and a regression test. No conflict with #13990 (disjoint lines in monitor.Start).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Aug 19, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | minor | `v5.4.0` → `v5.5.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v5.5.0`](https://github.com/docker/compose/releases/tag/v5.5.0) [Compare Source](docker/compose@v5.4.0...v5.5.0) #### What's Changed > ℹ️ This release overhauls image digest reconciliation to prevent unnecessary container recreation.\ > Existing containers may be recreated the first time you run `compose up` after upgrading, as image digests are re-evaluated using the new logic. > > `compose pull` now honors `pull_policy` refresh windows (`daily`, `weekly`, `every_N`). ##### ✨ Improvements - New image digest reconciliation process by [@​glours](https://github.com/glours) & [@​ndeloof](https://github.com/ndeloof) [#​14011](docker/compose#14011) [#​14041](docker/compose#14041) ##### 🐛 Fixes - Fix(bridge): skip pulling default image references for build-only ser… by [@​ericwyles](https://github.com/ericwyles) in [#​14010](docker/compose#14010) - Fix(watch): stop pruning every dangling image of the project by [@​glours](https://github.com/glours) in [#​14012](docker/compose#14012) - Fix(config): resolve service environment when computing --hash by [@​glours](https://github.com/glours) in [#​14002](docker/compose#14002) - Fix(watch): skip unreadable directories instead of failing the watch by [@​Endika](https://github.com/Endika) in [#​13992](docker/compose#13992) - Fix: ignore one-off container events in up monitor by [@​brano-osif](https://github.com/brano-osif) in [#​14038](docker/compose#14038) - Fix(bridge): validate arguments of bridge subcommands by [@​glours](https://github.com/glours) in [#​14003](docker/compose#14003) - Fix(images): tolerate containers whose image record is gone by [@​ndeloof](https://github.com/ndeloof) in [#​14028](docker/compose#14028) ##### 🔧 Internal - Test: Set stop\_signal to SIGTERM in nginx-based services by [@​ricardobranco777](https://github.com/ricardobranco777) in [#​13881](docker/compose#13881) - Chore: inline needlessly extracted single-use helpers by [@​ndeloof](https://github.com/ndeloof) in [#​14048](docker/compose#14048) - Add ENGINE column driven by label by [@​nicksieger](https://github.com/nicksieger) in [#​13959](docker/compose#13959) ##### ⚙️ Dependencies - Build(deps): bump github.com/moby/moby/client from 0.5.0 to 0.5.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​13999](docker/compose#13999) - Build(deps): bump github/codeql-action/upload-sarif from 4.37.3 to 4.37.4 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14009](docker/compose#14009) - Build(deps): bump github/codeql-action/upload-sarif from 4.37.4 to 4.37.5 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14019](docker/compose#14019) - Build(deps): bump github.com/moby/buildkit from 0.32.1 to 0.32.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14033](docker/compose#14033) - Build(deps): bump github.com/docker/buildx from 0.36.0 to 0.36.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14034](docker/compose#14034) - Build(deps): bump docker/github-builder/.github/workflows/bake.yml from 1.15.0 to 1.16.0 in the docker-actions group by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14035](docker/compose#14035) - Build(deps): bump github.com/moby/go-archive from 0.3.2 to 0.3.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14043](docker/compose#14043) - Build(deps): bump github/codeql-action/upload-sarif from 4.37.5 to 4.37.6 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14022](docker/compose#14022) - Build(deps): bump github.com/docker/cli from 29.6.2+incompatible to 29.7.2+incompatible by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14042](docker/compose#14042) - Build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​14008](docker/compose#14008) - Bump golang to version 1.26.6 by [@​glours](https://github.com/glours) in [#​14045](docker/compose#14045) #### New Contributors - [@​ericwyles](https://github.com/ericwyles) made their first contribution in [#​14010](docker/compose#14010) - [@​Endika](https://github.com/Endika) made their first contribution in [#​13992](docker/compose#13992) - [@​brano-osif](https://github.com/brano-osif) made their first contribution in [#​14038](docker/compose#14038) **Full Changelog**: <docker/compose@v5.4.0...v5.5.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
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
up --abort-on-container-exittears down the whole project when a one-off container created bydocker compose runexits.monitor.Startalready excludes one-off containers from the container list it builds viaoneOffFilter(false), but theapi.Eventssubscription did not. The only guard on an incoming event is the service label, which a one-off container inherits from the service it was run from. This applies the same filter to the event subscription.Regression since v2.39.0 (v2.38.2 is the last unaffected release). Same bug as docker-archive/compose-cli#1955, fixed there by docker-archive/compose-cli#1987 with this same filter. #13152 / #13178 are the same class in the exec path.
The monitor's initial container list already applies
oneOffFilter(false). This just makes the event stream agree with it. Same for the other caller,Logswith--follow, whose container set is built withoneOffExclude.Adds
TestCascadeIgnoresOneOffContainertopkg/e2e/cascade_test.go: it fails on unpatched main withAborting on container exit...and passes with the fix.TestCascadeStopandTestCascadeFailstill pass.This supersedes #14021, which carries the same one-liner. That PR is approved but its DCO check needs an amended commit from its author. This branch is signed off and adds the regression test. Happy to close this one if #14021 gets updated instead.
Related issue
fixes #14020
(not mandatory) A picture of a cute animal, if possible in relation to what you did
