mirror of https://github.com/pulumi/pulumi.git
5a96693d5b
This change is composed of two pieces: one to guard access to the binding operations and their results using a mutex, and one to make the result of PartialPackage.Snapshot safe to use concurrently. The former set of changes is pretty straighforward, and just involves adding a mutex and appropriate locking/unlocking around binding operations and reads/writes from/to PartialPackage.def. The latter change is a bit riskier. The result of PartialPackage.Snapshot is a *Package. Prior to these changes, multiple calls to Snapshot would return a pointer to the same Package value after updating its fields. Becuase the *Package API is field-based instead of method-based, there is no way to make the update itself concurrency-safe, as there's nowhere to add locking, and it is not possible to atomically update some of the fields that are being updated (e.g. slice-typed fields). After these changes, each call to Snapshot will return a new copy of the package. By far the riskiest part of this change is that pointer equality can no longer be used with the result of Snapshot to determine whether or not two *Package values are the same. To facilitate proper equality comparison, these changes add Equals() and Identity() methods to the *Package API. The former compares two *Packages; the latter returns a stringified version of the *Package's name and version that can be used as a map key. Fixes #9667. |
||
---|---|---|
.. | ||
bind.go | ||
docs_parser.go | ||
docs_renderer.go | ||
docs_test.go | ||
loader.go | ||
package_reference.go | ||
pulumi.json | ||
schema.go | ||
schema_test.go |