mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
startMx exists to serialize ContainerStart calls because the engine assigns published ports from ranges non-atomically. It is held by the plan executor's execStartContainer — a nearly dead code path (plans only emit OpStartContainer for paused/dead containers) — and NOT by startServiceContainer, the path every up/start actually runs. The protection is thus inoperative today: concurrent services publishing overlapping port ranges can race in the engine. Take the mutex around the real ContainerStart call and document the contract on the variable. Starts of different services were already serialized per-service (replicas start sequentially); this serializes the API call across services too, matching what the plan engine will do once the start phase converges (#14081). Part of #14074 (section C) / #14081 (lot 0). Signed-off-by: Nicolas De Loof <[email protected]>