657932261b
The Close methods on shadow.Values require pointer receivers because they contain a sync.Mutex, but that value was being copied through Value.Interface by the closeWalker. Because reflectwalk passes the struct fields to the StructField method as they are defined in the struct, and they may have been read as a value, we can't immediately call Interface() to check the method set without possibly copying the internal mutex values. Use the Implements method to first check if we need to call Interface, and if it's not, then we can check if the value is addressable. Because of this use of reflection, we can't vet for the copying of these locks. The minimal amount of code in the Close method left us only with a race detected within the mutex itself, which leads to a stacktrace pointing to the runtime rather than our code. |
||
---|---|---|
.. | ||
acctest | ||
config | ||
copy | ||
diff | ||
encryption | ||
experiment | ||
hashcode | ||
hilmapstructure | ||
logging | ||
mutexkv | ||
pathorcontents | ||
resource | ||
schema | ||
shadow | ||
signalwrapper | ||
slowmessage | ||
structure | ||
validation | ||
variables | ||
wrappedreadline | ||
wrappedstreams | ||
README.md |
README.md
Helper Libraries
This folder contains helper libraries for Terraform plugins. A running joke is that this is "Terraform standard library" for plugins. The goal of the packages in this directory are to provide high-level helpers to make it easier to implement the various aspects of writing a plugin for Terraform.