Andrey Turbanov created MSHARED-803:
---------------------------------------

             Summary: CommandLineUtils should set names for Threads
                 Key: MSHARED-803
                 URL: https://issues.apache.org/jira/browse/MSHARED-803
             Project: Maven Shared Components
          Issue Type: Improvement
          Components: maven-shared-utils
            Reporter: Andrey Turbanov


CommandLineUtils now creates Threads with default names, like Thread-1
I noticed it in one of thread-dump for hang maven build
{noformat}
Thread-109" #309 daemon prio=5 os_prio=0 tid=0x00007f1ce0005000 nid=0x13b3c 
runnable [0x00007f1d3a3f6000]
   java.lang.Thread.State: RUNNABLE
  at java.io.FileInputStream.readBytes(Native Method)
  at java.io.FileInputStream.read(FileInputStream.java:255)
  at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
  - locked <0x00000000ebdca730> (a java.lang.UNIXProcess$ProcessPipeInputStream)
  at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
  at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
  at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
  - locked <0x00000000ebdca718> (a java.io.InputStreamReader)
  at java.io.InputStreamReader.read(InputStreamReader.java:184)
  at java.io.BufferedReader.fill(BufferedReader.java:161)
  at java.io.BufferedReader.readLine(BufferedReader.java:324)
  - locked <0x00000000ebdca718> (a java.io.InputStreamReader)
  at java.io.BufferedReader.readLine(BufferedReader.java:389)
  at 
org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.StreamPumper.run(StreamPumper.java:76)
{noformat}

It would be nice to set names for threads created by CommandLineUtils
{code}
        final StreamFeeder inputFeeder = systemIn != null ? new StreamFeeder( 
systemIn, p.getOutputStream() ) : null;
        inputFeeder.setName("StreamFeeder-systemIn-process-" + p);

        final StreamPumper outputPumper = new StreamPumper( p.getInputStream(), 
systemOut );
        inputFeeder.setName("StreamPumper-systemOut-process-" + p);

        final StreamPumper errorPumper = new StreamPumper( p.getErrorStream(), 
systemErr );
        errorPumper.setName("StreamPumper-systemOut-process-" + p);
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to