compose/pkg
Nicolas De Loof 55a8a88265 fix(executor): a failed pre_start no longer lets start fire its own event
Two review findings on the same root cause:

- docker-agent: a failing OpRunPreStart emitted a bare Error with no
  preceding Working/Starting event, since triggersWorking only fires
  on OpStartContainer. onNodeError now emits the group's Working event
  first when it hasn't fired yet, keeping the progression well-formed.

- glours (following up on the docker-agent thread): worse than a
  missing event -- OpStartContainer's own goroutine was unblocked by
  <-done[dep.ID] and ran anyway, since close(done[node.ID]) races
  ahead of errgroup's cancel() (same TOCTOU class as the ctx.Err()
  guards already tracked under #14081, but deterministic here with the
  default unset --parallel limiter: no semaphore wait gives cancel()
  time to land first). It fired a second, spurious Starting right
  after the sibling's Error, with no further event ever closing it.
  Reproduced 143/143 iterations against this PR's own regression test.

run() now records each node's terminal error in a shared, mutex-guarded
map as it closes done[node.ID], and a dependent checks that map right
after its dependency wait, treating a genuine dependency failure
exactly like a context cancellation: no slot acquired, no event
emitted, its own failure recorded and propagated to its own
dependents the same way. This closes the event-ordering race outright
for this specific chain, rather than narrowing it like the existing
ctx.Err() guards -- those stay in place and still guard actual engine
calls, unrelated to event emission.

TestExecutePlanFailedPreStartGatesStart now asserts the full event
sequence (Creating, Created, Starting, Error — nothing after),
verified by reverting the executor.go fix locally and confirming the
test catches the reintroduced spurious Starting.

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(executor): a failed pre_start no longer lets start fire its own event 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