pulumi/pkg/codegen/schema
Pat Gavlin 5a96693d5b
[schema] Make PartialPackage concurrency-safe (#9675)
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.
2022-05-24 17:47:43 -07:00
..
bind.go [schema] Add support for on-demand binding. (#9620) 2022-05-23 15:44:35 -07:00
docs_parser.go [codegen/schema] Skip processing a line if the block position is greater than the length of the line. (#5002) 2020-07-16 16:59:06 -07:00
docs_renderer.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
docs_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
loader.go [schema] Make PartialPackage concurrency-safe (#9675) 2022-05-24 17:47:43 -07:00
package_reference.go [schema] Make PartialPackage concurrency-safe (#9675) 2022-05-24 17:47:43 -07:00
pulumi.json [schema] Add enum overlay support. (#8425) 2021-11-16 15:53:28 -08:00
schema.go [schema] Make PartialPackage concurrency-safe (#9675) 2022-05-24 17:47:43 -07:00
schema_test.go [schema] Make PartialPackage concurrency-safe (#9675) 2022-05-24 17:47:43 -07:00