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

[WORKAROUND] executeCommandLineAsCallable hangs reading open std/out on exited Process as JVM bug

    XMLWordPrintableJSON

    Details

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

      Description

      Need additional parameter to force closing out and error stream after Process exit. The parameter in the old method waitForAllPumpers( inputFeeder, outputPumper, errorPumper ) and the enclosing method executeCommandLineAsCallable().
      Java does not close FileInputStream. The native stream is mapped to file system.
      Reproduced with maven-shared-utils:0.9
      This is the thread dump:

      Main Thread:
      Stack trace:
      java.lang.Object.wait(Native Method)
      java.lang.Object.wait(Object.java:485)
      org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.AbstractStreamHandler.waitUntilDone(AbstractStreamHandler.java:42)
      org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.StreamPumper.waitUntilDone(StreamPumper.java:42)
      org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.CommandLineUtils.waitForAllPumpers(CommandLineUtils.java:339)
      org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.CommandLineUtils.access$200(CommandLineUtils.java:41)
      org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.CommandLineUtils$1.call(CommandLineUtils.java:285)
      org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:616)
      org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
      org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
      org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)

      Name: Thread-3
      State: RUNNABLE
      Total blocked: 0 Total waited: 0

      Stack trace:
      java.io.FileInputStream.readBytes(Native Method)
      java.io.FileInputStream.read(FileInputStream.java:220)
      java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
      java.io.BufferedInputStream.read(BufferedInputStream.java:317)

      • locked java.io.BufferedInputStream@3c640f1a
        sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
      • locked java.io.InputStreamReader@4d1b92ef
        java.io.InputStreamReader.read(InputStreamReader.java:167)
        java.io.BufferedReader.fill(BufferedReader.java:136)
        java.io.BufferedReader.readLine(BufferedReader.java:299)
      • locked java.io.InputStreamReader@4d1b92ef
        java.io.BufferedReader.readLine(BufferedReader.java:362)
        org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.StreamPumper.run(StreamPumper.java:76)

      Name: Thread-4
      State: RUNNABLE
      Total blocked: 0 Total waited: 0

      Stack trace:
      java.io.FileInputStream.readBytes(Native Method)
      java.io.FileInputStream.read(FileInputStream.java:220)
      sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
      sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
      sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)

      • locked java.io.InputStreamReader@2b87514a
        java.io.InputStreamReader.read(InputStreamReader.java:167)
        java.io.BufferedReader.fill(BufferedReader.java:136)
        java.io.BufferedReader.readLine(BufferedReader.java:299)
      • locked java.io.InputStreamReader@2b87514a
        java.io.BufferedReader.readLine(BufferedReader.java:362)
        org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.StreamPumper.run(StreamPumper.java:76)

        Attachments

          Activity

            People

            • Assignee:
              tibordigana Tibor Digana
              Reporter:
              tibordigana Tibor Digana
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: