compose/pkg
Nicolas De Loof de85d399ee fix: a failed pre_start/start no longer lets its dependent run
A node's done-channel closes strictly before errgroup cancels its
derived context on that same error - the close happens synchronously
inside the failing node's goroutine, ctx cancellation only after it
returns. A dependent blocked in run()'s
select { case <-done[dep.ID]: ...; case <-ctx.Done(): ... } therefore
always sees its dependency's done-channel ready first, regardless of
whether that dependency failed for a genuine reason or was cancelled.

execCreateHookContainer already guarded against exactly this. The two
other new dispatch functions from the previous commit did not:
execStartContainer's enriched branch could call ContainerStart right
after its OpRunPreStart failed for real (e.g. "no hook runner
container found"), contradicting pre_start.go's documented guarantee
that a non-zero hook exit gates service start - and symmetrically for
execRunPostStart after a failed OpStartContainer.

Both now bail out on ctx.Err() first, mirroring the existing guard.
Pinned by a regression test reproducing the race deterministically: no
ContainerStart expectation is registered, so the unguarded code calls
it from inside the errgroup worker goroutine, where gomock's missing-
expectation failure hangs the test binary instead of failing it
cleanly - a stronger tell than a plain assertion failure would have
been.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-10-06 14:11:22 +02:00
..
api feat: executor runs start-phase operations 2026-10-06 14:11:22 +02:00
bridge build(deps): adopt compose-go jobs and the container-spec layering 2026-09-21 16:35:20 +02:00
compose fix: a failed pre_start/start no longer lets its dependent run 2026-10-06 14:11:22 +02:00
dryrun fix: start lists service containers through getContainers 2026-09-30 12:03:10 +02:00
e2e docs(provider), e2e: image distribution documented and exercised 2026-10-02 17:35:20 +02:00
mocks PRIVATE_PORT optional for docker compose port 2026-09-11 11:35:18 +02:00
remote golangci-lint: enable perfsprint linter 2026-09-10 10:25:34 +02:00
utils fix: make e2e tests pass reliably locally with Docker Desktop 2026-05-18 10:55:41 +02:00
watch golangci-lint: enable perfsprint linter 2026-09-10 10:25:34 +02:00