You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous algorithm exhibits the following issues when run on graphs
with cycles, in particular when the amount of edges is large:
1. Cycles of length 1 lead to infinite recursion.
2. The algorithm is inefficient in terms of execution time and memory
allocation, as it creates a copy of the
`predecessorNodes` set per recursion.
3. When run against [1] the execution of `toPackageReferenceForest()`
didn't finish within 15 minutes, causing high CPU load and memory
consumption.
If GoMod used the dependency graph format already, the solution would be
as simple as calling `DependencyGraphBuilder.breakCycles()`. Fix the
problem by copying the code of `DependencyGraphBuilder.breakCycles()` as
a temporary quick fix. This saves effort, because refactoring GoMod to
use the dependency graph is planned anyway [2], which will allow for
removing that copied code again.
[1] https://github.com/ossf/scorecard
[2] #4249Fixes#5627.
Signed-off-by: Frank Viernau <[email protected]>
0 commit comments