You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/01/16 21:28:39 UTC

[GitHub] [maven] michael-o commented on a change in pull request #662: [MNG-7381] Shorten thread name to artifactId, conditionally with groupId

michael-o commented on a change in pull request #662:
URL: https://github.com/apache/maven/pull/662#discussion_r785497688



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
##########
@@ -183,19 +196,26 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
     private Callable<ProjectSegment> createBuildCallable( final MavenSession rootSession,
                                                           final ProjectSegment projectBuild,
                                                           final ReactorContext reactorContext,
-                                                          final TaskSegment taskSegment, final ThreadOutputMuxer muxer )
+                                                          final TaskSegment taskSegment,
+                                                          final ThreadOutputMuxer muxer,
+                                                          final Set<String> duplicateArtifactIds )
     {
         return () ->
         {
             final Thread currentThread = Thread.currentThread();
             final String originalThreadName = currentThread.getName();
-            currentThread.setName( "mvn-builder-" + projectBuild.getProject().getId() );
+            final MavenProject project = projectBuild.getProject();
+
+            final String threadNameSuffix = duplicateArtifactIds.contains( project.getArtifactId() )
+                    ? project.getGroupId() + ":" + project.getArtifactId()
+                    : project.getArtifactId();
+            currentThread.setName( "mvn-builder_" + threadNameSuffix );

Review comment:
       Do you expect this to be a problem? This adds inconsistency to the rest of our thread names. I would only address it if is a problem only.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org