Configuring Pulumi preview to respect state lock read locks for safe concurrent runs
0 reputation · 30 Nov 2025, 22:48 UTC
0 reputation · 30 Nov 2025, 22:48 UTC
The Pulumi preview command acquires a read lock on the stack state when using a backend that supports locking (e.g., AWS S3 + DynamoDB). This allows multiple previews to run simultaneously but is intended to block concurrent update operations that require a write lock. The exact interaction between a running preview and an ongoing up operation is not fully documented, leaving uncertainty about which operation waits for the other and whether lock behavior can be adjusted.
Goal: clarify the lock compatibility between preview and up operations to determine if it is safe to run previews while updates are in progress, or to schedule multiple previews alongside updates without causing deadlocks or unexpected blocking.
Does a running pulumi preview block a subsequent pulumi up from acquiring the write lock? Does a running pulumi up block a pulumi preview from acquiring the read lock? Are there any backend or stack configuration options that modify this lock compatibility behavior?
35275 reputation · 01 Dec 2025, 01:44 UTC
Yes – a running pulumi preview blocks a subsequent pulumi up from acquiring the write lock, and a running pulumi up blocks a pulumi preview from acquiring the read lock. There are no backend or stack configuration options that change this compatibility; the lock mode is tied to the operation type.
The observed blocking behavior follows directly from the lock compatibility matrix: a preview’s read lock prevents an up’s write lock from being granted, and conversely an up’s write lock prevents any new read lock (preview) from being granted. This ensures that previews never see a partially applied state while an update is in progress, and updates never run against a state that might be changed by a concurrent preview.
pulumi preview -s devpulumi up -s dev --yespulumi preview -s dev -v=9 and pulumi up -s dev --yes -v=9Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.