mirror of
https://github.com/docker/compose.git
synced 2026-11-17 21:57:19 +00:00
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> |
||
|---|---|---|
| .. | ||
| api | ||
| bridge | ||
| compose | ||
| dryrun | ||
| e2e | ||
| mocks | ||
| remote | ||
| utils | ||
| watch | ||