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 #1027
  • Loading branch information
Christoph Läubrich authored and michael-o committed Mar 3, 2023
1 parent ae828e4 commit a0f460c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ 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 a0f460c

Please sign in to comment.