Skip to content
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

[sdk/nodejs] Account for outstanding async work done in prepareResource #7704

Merged
merged 5 commits into from
Aug 4, 2021

Conversation

EvanBoyle
Copy link
Contributor

Fixes #6998

Turns out we weren't adding prepareResource work the the keep-alive queue. We were waiting until runAsyncResourceOp which happens in a .then chained off of prepareResource. The automation api shutdown routine, runtime.disconnect, was unaware of this outstanding work as a result.

@EvanBoyle EvanBoyle merged commit 8b918e5 into master Aug 4, 2021
@pulumi-bot pulumi-bot deleted the evan/nodeAutoRace branch August 4, 2021 17:27
@@ -563,6 +569,9 @@ async function prepareResource(label: string, res: Resource, custom: boolean, re
}
}

// free the RPC queue
done();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to put this in a finally to ensure it runs even if there are errors? It looks like all other places we use rpcKeepAlive do that?

Also - this pattern seems fundamentally somewhat flimsy. This may be a necessary patch to take - but I expect we'll need to revisit whether this approach overall is the right foundation for ensuring we track all async work correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Follow up here: #7707

this pattern seems fundamentally somewhat flimsy
Agree, I called this out in slack. Unfortunately our current architecture forces us to account for async work as we allow reusing the process across multiple automation api updates. Open to ideas or brainstorming here. Perhaps we could move some of this accounting into the debuggablePromise implementation, but that just sort of shifts the problem around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Channel has been shut down" errors in automation.
3 participants