What happened:
There is a done map in discover. If you recursively enter discover(nodeA) -> discover(nodeA), it will deadlock, as the second discover call will wait for the done channel for nodeA in the done map will wait for nodeA to complete. The issue is that the vertex is added only after this done map check (currently to ensure the vertex is only added once). Thus, we cannot call AddEdge(nodeA, nodeA) (which would do the cycle check) before calling the discover as in common cases (AddEdge(nodeA, nodeB)), nodeB would not exist yet.
Reproducing test: https://github.com/open-component-model/open-component-model/pull/1046/files
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
Environment:
What happened:
There is a done map in discover. If you recursively enter
discover(nodeA)->discover(nodeA), it will deadlock, as the second discover call will wait for the done channel for nodeA in the done map will wait for nodeA to complete. The issue is that the vertex is added only after this done map check (currently to ensure the vertex is only added once). Thus, we cannot callAddEdge(nodeA, nodeA)(which would do the cycle check) before calling thediscoveras in common cases (AddEdge(nodeA, nodeB)), nodeB would not exist yet.Reproducing test: https://github.com/open-component-model/open-component-model/pull/1046/files
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
Environment: