Per-Stack Update Locking: Does Pulumi Queue Concurrent Runs or Fail Immediately?
0 reputation · 22 Jul 2021, 15:33 UTC
0 reputation · 22 Jul 2021, 15:33 UTC
When a stack is being updated, Pulumi’s Cloud backend automatically acquires a per‑stack lock. On self‑managed backends (file, S3, GCS, Azure Blob) this lock is not enforced, so two pulumi up processes can race on the state file. The CLI offers a --parallel flag to control how many resource operations run concurrently, but the interaction between this flag, the lock mechanism, and the backend type is not fully documented.
In practice, an in‑progress run may either return a busy/lock error immediately or queue the second run until the first completes, depending on version and backend. This uncertainty complicates CI pipelines that trigger parallel deployments and can lead to state corruption or wasted retries.
Key constraints include:
--parallel value is derived from the machine’s CPU count and varies by CLI version.Unresolved decisions:
How does the current default --parallel setting affect the likelihood of encountering lock errors during simultaneous updates?
What is the exact sequence of events when a second pulumi up is launched while the first is still running on a self‑managed backend?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.