-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix nodejs resource functions (ie registerResource) to properly propagate errors #6644
Conversation
The original repro that lead me to discover this. Unforunately it takes ~5 mins to run and only fails ~80% of the time: #6645 |
…odejsRuntimeErrors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set up a test for this using mocks? Throwing from within newResource
should work, I think.
@pgavlin wouldn't that just be testing the mocked registerResource implementation? If so that wouldn't really validate this fix. I had a hard time coming up with a way to test this. The only repro I currently have is the one linked here #6645 and it takes 5 minutes to fail, and the failure is non-deterministic as it seems related to resource exhaustion at some layer. |
(the mocked registerResource impl does't call prepareResource which is the layer at which the fix was made) |
When using a mock, The Line 342 in ff2cf70
pulumi/sdk/nodejs/runtime/resource.ts Line 284 in ff2cf70
And then call's the monitor's pulumi/sdk/nodejs/runtime/resource.ts Line 340 in ff2cf70
|
@justinvp ah, thanks for the pointer. I did forgot that this was mocking the monitor and not the exported calls in runtime. I'll work on getting these tests added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do something similar for the resolvers for all the other outputs in transferProperties
?
This is a very good point. These are actually the most common outstanding promises that we see leaked, and that would make sense as we aren't properly rejecting them... Fix incoming. |
EDIT: |
Fixes #6643
More detail in the issues above, but TLDR is that we were swallowing errors in registerResource. This change fixes
prepareResource
to set up reject handlers on ID and URN promises to appropriately propagate the errors.