Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,8 @@ To replicate functionality in `terraform_docs` hook:
### terraform_validate

> [!IMPORTANT]
> If you use [`TF_PLUGIN_CACHE_DIR`](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache), we recommend enabling `--hook-config=--retry-once-with-cleanup=true` or disabling parallelism (`--hook-config=--parallelism-limit=1`) to avoid [race conditions when `terraform init` writes to it](https://github.com/hashicorp/terraform/issues/31964).
> If you use [`TF_PLUGIN_CACHE_DIR`](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache), we recommend enabling `--hook-config=--retry-once-with-cleanup=true` or disabling parallelism (`--hook-config=--parallelism-limit=1`) to avoid [race conditions when `terraform init` writes to it](https://github.com/hashicorp/terraform/issues/31964).
Comment thread
yermulnik marked this conversation as resolved.
> This [issue was fixed in OpenToFu v1.10+](https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2/#global-provider-cache-locking), so it's safe to use parallelism with it.
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "OpenToFu" should be "OpenTofu" (missing the second 'o').

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

OpenTofu v1.10 release notes global provider cache locking fix

💡 Result:

In the OpenTofu v1.10.x release line, the “global provider cache locking” change and the later “locking fix” show up as:

  • v1.10.0 (prereleases / beta notes): the shared provider cache controlled by TF_PLUGIN_CACHE_DIR gained filesystem-level locking so concurrent OpenTofu runs (e.g., many parallel tofu init in CI) don’t clobber the cache. [2]
  • v1.10.5 (bugfix): fixed an issue where using TF_PLUGIN_CACHE_DIR could cause unexpected lock contention errors (GitHub issue/PR #3090). Release notes also remind users it’s still recommended to have valid .terraform.lock.hcl files when using TF_PLUGIN_CACHE_DIR. [1]

Sources: [1] (newreleases.io) [2] (opentofu.org)

Citations:


🌐 Web query:

OpenTofu v1.10 final release TF_PLUGIN_CACHE_DIR race condition

💡 Result:

OpenTofu v1.10.0 (final) is the release line that addresses the long-standing race condition / unsafeness of sharing TF_PLUGIN_CACHE_DIR across concurrent tofu init runs by adding filesystem-level locking around the shared provider plugin cache (“Global Provider Cache Lock”), making concurrent operations (CI, Terragrunt, parallel pipelines) safe in the intended design. [1], [2], [3]

Notes/caveats from the v1.10 series:

  • The underlying problem was tracked as “provider plugin cache is not safe to access concurrently” (race during concurrent installs into the cache). [1]
  • The locking work landed during the 1.10.0 prereleases and is described as making the cache safe for concurrent OpenTofu operations. [2], [3]
  • There were still follow-on issues in the 1.10 patch line (e.g., “unexpected lock contention errors”) that were later fixed (example: v1.10.5 notes). [4]

Practical takeaway: If you’re asking whether v1.10.0 is the version where TF_PLUGIN_CACHE_DIR becomes concurrency-safe (i.e., the race condition is addressed), yes—that change is part of OpenTofu 1.10; and if you hit locking-related errors, upgrade within the 1.10.x line (at least past fixes like 1.10.5). [2], [4]

Sources: [1] GitHub issue, [2] OpenTofu 1.10.0-beta1 blog, [3] OpenTofu 1.10.0-alpha2 blog, [4] v1.10.5 changelog excerpt.


Link to the official OpenTofu v1.10.0 release notes instead of the alpha blog.

The alpha2 blog post documents the fix, but OpenTofu's official v1.10.0 release notes or the beta blog would be a more stable reference. Additionally, note that v1.10.5+ is recommended if users encounter lock contention errors during concurrent cache access.

🤖 Prompt for AI Agents
In `@README.md` around lines 972 - 974, Update the [!IMPORTANT] block that
currently links to the OpenTofu alpha2 blog: replace the alpha blog URL with the
official OpenTofu v1.10.0 release notes (and/or the stable beta release notes)
URL, change the wording to reference the official v1.10.0 release notes instead
of the alpha blog, and append a note recommending v1.10.5+ if users still see
lock contention errors when using concurrent cache access; target the markdown
block starting with the [!IMPORTANT] marker and the sentence mentioning "This
[issue was fixed in OpenTofu v1.10+]" to make these edits.

Comment thread
MaxymVlasov marked this conversation as resolved.
Outdated

1. `terraform_validate` supports custom arguments so you can pass supported `-no-color` or `-json` flags:

Expand Down
Loading