Skip to content

bug: cyclic dependency can cause an endless loop #1047

@Skarlso

Description

@Skarlso

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ipceiImportant Project of Common European Interestkind/bugfixBug

    Type

    No fields configured for Bug.

    Projects

    Status
    🍺 Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions