Skip to content

Handle destroy events in up monitor - #13988

Open
ousamabenyounes wants to merge 1 commit into
docker:mainfrom
ousamabenyounes:13985-monitor-destroy-without-die
Open

Handle destroy events in up monitor#13988
ousamabenyounes wants to merge 1 commit into
docker:mainfrom
ousamabenyounes:13985-monitor-destroy-without-die

Conversation

@ousamabenyounes

Copy link
Copy Markdown

What I did
Handle container destroy events in the attached up monitor so docker compose up can finish when an externally stopped project removes a container that never emitted a die event.

The monitor still uses die for exit status and restart detection; destroy only removes the container from the tracked set so the monitor can terminate when the project is gone.

Related issue
Fixes #13985

Test verification (RED -> GREEN)

RED on origin/main with the new regression test only:

=== RUN   TestMonitorStopsAfterDestroyWithoutDie
    monitor_test.go:73: monitor did not stop after all containers were destroyed
--- FAIL: TestMonitorStopsAfterDestroyWithoutDie (1.00s)
FAIL
FAIL	github.com/docker/compose/v5/pkg/compose	1.026s

GREEN on this branch:

=== RUN   TestMonitorStopsAfterDestroyWithoutDie
--- PASS: TestMonitorStopsAfterDestroyWithoutDie (0.00s)
PASS
ok  	github.com/docker/compose/v5/pkg/compose	0.023s

Full local validation:

./run-ci.sh
DONE 574 tests, 2 skipped
make lint: golangci-lint run --build-tags "e2e" ./... -> 0 issues

Signed-off-by: Ben Younes <2910651+ousamabenyounes@users.noreply.github.com>
@ousamabenyounes
ousamabenyounes requested review from a team as code owners July 31, 2026 07:13
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.

[BUG] Attached up never exits after external stop+down when a container is in restart backoff (regression in v2.39.3)

1 participant