Skip to content

Commit

Permalink
[MNG-7716] ConcurrencyDependencyGraph deadlock if no root is selected
Browse files Browse the repository at this point in the history
If ConcurrencyDependencyGraph#getRootSchedulableBuilds returns an empty
list then MultiThreadedBuilder is locked forever as it never gets a
build result (because nothing is scheduled).

This changes the method, that in such case just the first project is
returned, this might not give the best performance, but ensures that
there is at least one build scheduled and the build-loop can proceed.

This closes #1028
  • Loading branch information
Christoph Läubrich authored and michael-o committed Mar 3, 2023
1 parent 3d4fee3 commit 837db7a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public List<MavenProject> getRootSchedulableBuilds() {
result.add(projectBuild.getProject());
}
}
if (result.isEmpty() && projectBuilds.size() > 0) {
// Must return at least one project
result.add(projectBuilds.get(0).getProject());
}
return new ArrayList<>(result);
}

Expand Down

0 comments on commit 837db7a

Please sign in to comment.