Asynchronous call inside a Policy Pack #307
Labels
impact/usability
Something that impacts users' ability to use the product easily and intuitively
kind/bug
Some behavior is incorrect or out of spec
What happened?
When I'm trying to call an asynchronous API inside a policy pack, it generates this error:
"error: Exception calling application: There is no current event loop in thread 'ThreadPoolExecutor-0_0'. ".
Even if I add async/await to the function or even using pulumi.routine.sync_await the asyncronous call doesn't work.
I think is missing the asyncio.get_event_loop() function in the generation of the thread when is called the policy Pack.
This is the function:
Expected Behavior
I would expect that at least the function generates an output but it doesn't.
Steps to reproduce
Create a policy pack.
Add the function written in the description.
Create a ResourceValidationPolicy and a PolicyPack
Try to execute it with a project.
Output of
pulumi about
error: Exception calling application: There is no current event loop in thread 'ThreadPoolExecutor-0_0'
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: