Hello, it seems that I’ve a deadlock in my Pulumi ...
# golang
b
Hello, it seems that I’ve a deadlock in my Pulumi code and I’d like to know if there are ways to troubleshoot them because I can’t find them by reading the code?
s
what do you mean by deadlock?
b
The stack is still creating (creating with the animated dots is still showing) but nothing is progressing (no resource creation nor destruction is happening).
s
thats not a golang issue, thats a platform issue. You should ping support
b
What makes me think I've a deadlock is the fact that if I remove a DependsOn the stack is updated correctly. However, I don't understand how the DependsOn can harm in this case.
s
yeah I haven't tried that yet. I use the automate api and i list things in the order which I want them to run lol
b
Resource creation order isn’t guaranteed to be the same than their declaration in the code: the code only registers the resources, effectively creating a dependency graph of resources which is then processed by the engine, calling the various providers to create the resources in the end. I let a maintainer correct me if I’m wrong, but that’s what I understood.
a
@bored-spoon-83710 If it runs to completion without the
dependsOn
, but nothing happens with the
dependsOn
, it sounds like a deadlock in Pulumi (our bug, not yours). If you file an issue in pulumi/pulumi we should be able to address this. I’m not aware of any specific resources to address concurrency debugging beyond standard golang tooling. You’re right that “creating resources” just adds them to the current DAG. The engine drives resource creation regardless of the order of declaration. This is true for normal pulumi programs and the automation api.
b
Hello @ancient-policeman-24615, sorry for the late answer, I somehow missed your message 🤔 I fixed (at least it appears to be fixed) my issue by realizing that I could use the pulumi.DependsOn option several times (please tell me if this is a mistake) instead of using a single one with an append to concatenate several dependency lists. I’ve tried to read the code but I didn’t understand what’s the key difference between the two approaches, that’s why I’m not very confident that my issue is completely fixed (and not just hiding, ready to tackle me at the first opportunity 😛). Tell me if you still want me to open an issue (I guess you’ll need a reproducer, so maybe I won’t be able to provide one publicly).
a
@bored-spoon-83710 I’m glad you are not experiencing the bug anymore. I’m not sure what the benefit of concatenating dependsOn lists, I’m sure it is not intended to fix deadlocks 😵. I would definitely appreciate a bug report if possible.