mirror of
https://github.com/docker/compose.git
synced 2026-11-21 07:30:30 +00:00
Copilot review (High): the plan's own OpWaitCondition nodes (service_healthy / service_completed_successfully dependency waits, executed as part of executePlan) have no timeout of their own -- they block on whatever ctx they're given, unlike the imperative engine's waitDependencies, which already threaded WaitTimeout through every per-dependency wait, not just the final --wait check. upDetached only wrapped ctx with WaitTimeout around that final check, established after executePlan already returned -- so a condition that's never satisfied hung `up -d --wait --wait-timeout N` forever instead of failing after N seconds. Move the deadline to wrap ctx before executePlan runs (gated on Wait && WaitTimeout > 0, matching start()'s own gating), and reuse the same ctx for the final verification instead of opening a second, independent WaitTimeout window -- one overall budget for "becoming healthy" covering both the plan's in-flight waits and the final check. preparePlan is deliberately left outside the deadline: image pulls and the rest of create()'s own work were never bounded by --wait-timeout in the old create()+start() sequence either. Regression-tested at two levels: - TestExecutePlanWaitConditionRespectsContextDeadline drives a real OpWaitCondition node through executePlan/run() under a short deadline and asserts it returns promptly with ctx.Err(), proving the deadline propagates into the plan's blocking nodes. - The existing e2e TestUpWaitTimeout (up --wait --wait-timeout on a service that never turns healthy) is what actually exercises upDetached's own wiring: verified by ablation that reverting this fix makes it hang (test timeout) instead of failing after 3s. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> |
||
|---|---|---|
| .. | ||
| api | ||
| bridge | ||
| compose | ||
| dryrun | ||
| e2e | ||
| mocks | ||
| remote | ||
| utils | ||
| watch | ||