Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-803

CommandLineUtils should set names for Threads

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: maven-shared-utils
    • Labels:
      None

      Description

      CommandLineUtils now creates Threads with default names, like Thread-1
      I noticed it in one of thread-dump for hang maven build

      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)
      

      It would be nice to set names for threads created by CommandLineUtils

              final StreamFeeder inputFeeder = systemIn != null ? new StreamFeeder( systemIn, p.getOutputStream() ) : null;
              inputFeeder.setName("StreamFeeder-systemIn-" + p);
      
              final StreamPumper outputPumper = new StreamPumper( p.getInputStream(), systemOut );
              inputFeeder.setName("StreamPumper-systemOut-" + p);
      
              final StreamPumper errorPumper = new StreamPumper( p.getErrorStream(), systemErr );
              errorPumper.setName("StreamPumper-systemErr-" + p);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              turbanoff Andrey Turbanov
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: