This PR fixes an intermittent race condition where concurrent workspace_file resource creations would collide when automatically creating the target parent directory via client.Workspace.Mkdirs.#3
Conversation
|
The collision of concurrent threads in the The proposed encapsulation exclusively intercepts transient structured error responses (RESOURCE_ALREADY_EXISTS) triggered when a thread T2 attempts fractional millisecond allocation after T1 exposes the node in the file system, simulating native idempotency behavior ( The selective suppression of infrastructure errors prevents spurious failures in Terraform's massively parallel provisioning without altering the provider's abstract dependency graph. If upstream validation prefers handling via local mutex or exponential backoff in the gRPC/HTTP transport client layer to avoid API noise, please indicate the concurrency pattern accepted in your enterprise design. |
Changes
client.Workspace.Mkdirsexecution to check for parallel creation signals.RESOURCE_ALREADY_EXISTSandALREADY_EXISTStransient structural API responses, preventing unexpected failure when another concurrent thread creates the parent folder fractionally faster.