Skip to content

fix: allow detach during compose up startup wait - #14013

Open
CyberEclipses wants to merge 1 commit into
docker:mainfrom
CyberEclipses:investigate-13716-detach-healthcheck
Open

fix: allow detach during compose up startup wait#14013
CyberEclipses wants to merge 1 commit into
docker:mainfrom
CyberEclipses:investigate-13716-detach-healthcheck

Conversation

@CyberEclipses

Copy link
Copy Markdown

Fixes #13716

This updates the attached compose up flow so the interactive detach shortcut can interrupt the startup/wait phase.

Previously, the detach shortcut cancelled globalCtx, but service startup was executed with context.WithoutCancel(ctx). As a result, pressing d could cancel the interactive/log side while the startup/wait path continued until services reached running/healthy state.

This change introduces a detach-aware startup context. It keeps startup isolated from parent cancellation for the existing signal-handling behavior, while allowing the explicit detach action to cancel startup/wait and return control cleanly.

Validation:

  • gofmt -w pkg/compose/up.go
  • go test ./pkg/compose
  • go test ./pkg/compose -run Test
  • git diff --check
  • manual reproduction with a health-gated Compose project:
    • created a project where dependent waits on slow: condition: service_healthy
    • kept slow in healthcheck waiting state
    • ran /tmp/docker-compose -f /tmp/compose-13716-repro/compose.yaml up --menu
    • pressed d while slow was Waiting
    • confirmed the shell prompt returned immediately
    • confirmed slow remained running with docker ps
    • cleaned up with down -v --remove-orphans

@CyberEclipses
CyberEclipses requested review from a team as code owners August 6, 2026 22:09
@CyberEclipses
CyberEclipses requested review from glours and ndeloof August 6, 2026 22:09
Signed-off-by: Cyber Eclipse <143217084+CyberEclipses@users.noreply.github.com>
@CyberEclipses
CyberEclipses force-pushed the investigate-13716-detach-healthcheck branch from 0d5474d to ff65973 Compare August 6, 2026 22:16
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.

Detach pending during container health check

1 participant