mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-16 07:01:54 -04:00
All of the exported querying methods of Expander are supposed to hold a read lock whenever they Expander.exps, but this particular method was missing those calls and so it could potentially race with calls that write new expansions into the data structure. This seems to be quite hard to hit in practice because it can only arise if you have an "orphan" resource instance whose node happens to execute concurrently with the expansion node for a module or resource, but the race detector can sometimes catch it when executing TestContext2Apply_providerModuleIteration/apply_orphan_destroy from "package tofu". Signed-off-by: Martin Atkins <mart@degeneration.co.uk>