pulumi/sdk/nodejs/tests/runtime/langhost/cases
Justin Van Patten 9e73c75cd6 [sdk/nodejs] Fix hang due to component children cycles
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 case of the example, at step 3 the dependency expansion will stop: we won't look at `ComponentB`'s children because we're adding the dependency from `ComponentB`.

fix
2023-04-07 07:34:38 -07:00
..
000.empty Implement free variable calculations 2017-09-04 11:35:21 -07:00
001.one_resource Add auto-parenting 2017-10-15 04:38:26 -07:00
002.ten_resources Add auto-parenting 2017-10-15 04:38:26 -07:00
003.one_complex_resource Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
004.ten_complex_resources Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
005.resource_thens Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
006.asset Add auto-parenting 2017-10-15 04:38:26 -07:00
007.promises_io Add auto-parenting 2017-10-15 04:38:26 -07:00
008.ten_depends_on_resources Permit dependsOn that are Outputs (of Outputs) (#2198) 2018-11-19 11:22:55 -05:00
009.invoke Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
010.runtime_settings Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
011.unhandled_error Add a test. 2017-12-13 17:30:43 -08:00
012.assets_archive Harden asset and archive deserialization. (#3042) 2019-08-06 16:32:05 -07:00
013.unhandled_promise_rejection Add a test. 2017-12-13 17:30:43 -08:00
014.read_resource Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
015.runtime_sxs Stop using Get/SetRootResource in nodejs (#9680) 2022-06-30 11:04:49 +01:00
016.promise_leak Improve the promise leak experience (#1374) 2018-05-17 15:32:39 -07:00
017.parent_defaults Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
018.logging Fix an issue with NodeJS host logging (#1819) 2018-08-24 16:50:09 -07:00
019.stack_exports Incorporate PR feedback 2018-09-02 12:15:58 -07:00
020.property_dependencies Implement more precise delete-before-replace semantics. (#2369) 2019-01-28 09:46:30 -08:00
021.parent_child_dependencies Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
022.parent_child_dependencies_2 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
023.parent_child_dependencies_3 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
024.parent_child_dependencies_4 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
025.parent_child_dependencies_5 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
026.parent_child_dependencies_6 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
027.parent_child_dependencies_7 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
028.parent_child_dependencies_8 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
029.parent_child_dependencies_9 Update `@pulumi/pulumi` to version 0.17.0 (#2510) 2019-03-05 17:06:57 -08:00
030.import_resource Add support for importing existing resources. (#2893) 2019-07-12 11:12:01 -07:00
040.run_error Use result.Result in more places. (#2568) 2019-03-19 16:21:50 -07:00
041.component_opt_single_provider Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
042.component_opt_providers_array Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
043.depends_on_non_resource Ensure that the values in 'dependsOn' are actually Resources. (#2605) 2019-03-28 17:27:51 -07:00
044.versions Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
045.ignore_changes Add an ignoreChanges resource option (#2657) 2019-04-22 13:54:48 -07:00
046.recursive_stack_exports Properly handle recursive outputs without penalizing non-recursive ones. (#3206) 2019-09-10 12:29:52 -07:00
047.exported_function Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
048.exported_promise_function Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
049.exported_async_function Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
050.resource_creation_in_function Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
051.resource_creation_in_function_with_result Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
052.resource_creation_in_async_function_with_result Allow users to export a top-level function to serve as the entrypoint to their pulumi app. (#3321) 2019-12-09 11:28:20 -08:00
060.provider_invokes Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
061.provider_in_parent_invokes Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
062.providerref_invokes Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
063.providerref_in_parent_invokes Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
064.async_components Replace equal and deepEqual with strictEqual and deepStrictEqual (#5607) 2020-10-21 10:21:47 -07:00
065.large_resource add tests for node and python 2020-04-23 11:16:36 -07:00
066.replace_on_changes Add `replaceOnChanges` resource option (#7226) 2021-07-01 13:32:08 -06:00
067.native_es_module Support native ES module for node sdk (#7764) 2021-12-29 19:22:01 -08:00
068.remote_component_providers [sdk/nodejs] Pickup provider as part of providers (#8923) 2022-02-04 12:38:34 +01:00
069.ambiguous_entrypoints fix(ux): Adds a warning message when module resolution is ambiguous (#10374) 2022-08-16 14:41:15 -04:00
070.unusual_alias_names chore(sdk/nodejs): Adds tests for resource alias combinations 2022-09-16 14:18:59 -04:00
071.large_alias_counts chore(sdk/nodejs): Adds tests for resource alias combinations 2022-09-16 14:18:59 -04:00
072.large_alias_lineage_chains feat(sdk/nodejs): delegates alias computation to the engine 2022-12-15 17:23:31 -05:00
073.component_dependencies [sdk/nodejs] Fix hang due to component children cycles 2023-04-07 07:34:38 -07:00