mirror of https://github.com/pulumi/pulumi.git
5dd813ea47
When a resource depends on a local component resource, rather than setting the component resource itself as a dependency, each of the component's descendants is added as a dependency. This can lead to hangs when cycles are introduced. For example, consider the following parent/child hierarchy, where `ComponentA` is the parent of `ComponentB` and `ComponentB` is the parent of `CustomC`: ComponentA | ComponentB | CustomC If `ComponentB` specifies it has a dependency on `ComponentA`, the following takes place as part determining the full set of transitive dependencies: 1. `ComponentA` is a component resource so it isn't added as a dependency, its children are. 2. `ComponentA` has one child: `ComponentB` 3. `ComponentB` is a component resource so it isn't added as a dependency, its children are. 4. `ComponentB` has one child: `CustomC`, a custom resource. 5. Since `CustomC` is a custom resource, it is added to the set of dependencies. 6. We try to await its URN, but we'll never get it because `RegisterResource` hasn't yet been called for it. And we hang waiting. To address this, skip looking at a component's children if it is the component from which the dependency is being added. In the example, with the fix, at step 3 the dependency expansion will stop: we won't look at `ComponentB`'s children because we're adding the dependency from `ComponentB`. PR feedback |
||
---|---|---|
.. | ||
automation | ||
data/lazy_import_test | ||
langhost | ||
provider | ||
runtime | ||
__init__.py | ||
conftest.py | ||
helpers.py | ||
test_broken_dynamic_provider.py | ||
test_monitor_termination.py | ||
test_next_serialize.py | ||
test_output.py | ||
test_resource.py | ||
test_runtime_to_json.py | ||
test_stack_reference.py | ||
test_stack_registers_outputs.py | ||
test_translate_output_properties.py | ||
test_types_input_type.py | ||
test_types_input_type_types.py | ||
test_types_output_type.py | ||
test_types_resource_types.py | ||
test_urn.py | ||
test_utils.py |