https://pulumi.com logo
#general
Title
# general
d

dazzling-scientist-80826

05/14/2019, 9:03 PM
I’m getting the following error:
Copy code
The Pulumi runtime detected that 114 promises were still active
    at the time that the process exited. There are a few ways that this can occur:
      * Not using `await` or `.then` on a Promise returned from a Pulumi API
      * Introducing a cyclic dependency between two Pulumi Resources
      * A bug in the Pulumi Runtime
It definitely is the second case: a cyclic dependency, but I’m not sure how to break the cycle. I’ve got a lambda that closes over a function that constructs a config/context object sort of thing, but another lambda that needs the arn of that first lambda - is there some general trick to break the cycle in this sort of situation?
actually, i think the cycle is even simpler than that - i’ve got some lambda f that calls newContext and newContext is defined as
let newContext;
and then at the bottom fo the file
newContext = ...
where … includes some code that needs the arn of the lambda f
c

creamy-potato-29402

05/15/2019, 7:23 PM
hmm, cc @bitter-oil-46081?
b

bitter-oil-46081

05/15/2019, 7:28 PM
I am not really sure how to make that work. If I am understanding correctly, logically you want to end up with the source code for a lambda to end up capturing the arn that lambda is created with? Do you expect when you capture
newContext
you see the value that you end up defining later in the file? I think that the pattern of doing a let to initialize a variable, capturing that, and then latter assigning to it in the deployment program is going to lead to racy behavior since you don't have control over when the lambda which captured newContext is serialized.
15 Views