Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18742

Some Bamboo builds on Windows continue to run while processing stdout and stderr pumps long after the process has ended and no further logging is received

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • None
    • 5.10.2, 5.12.3.1
    • Windows
    • None

      Summary

      Bamboo builds on Windows continue to run while processing stdout and stderr pumps long after the process has ended and no further logging is received.

      Environment

      • Windows

      Steps to Reproduce

      Unknown.

      Expected Results

      After all child processes exit, if no further input is received, the streams should be closed and the build should complete.

      Actual Results

      The build will continue to run indefinitely and the following threads can be seen as running long after the child processes exit:

      "48:StdErrHandler java.lang.ProcessImpl@fb1d545" #48 prio=5 os_prio=0 tid=0x0000000016f1f800 nid=0x2020 runnable [0x000000001cc3e000]
         java.lang.Thread.State: RUNNABLE
      	at java.io.FileInputStream.readBytes(Native Method)
      	at java.io.FileInputStream.read(FileInputStream.java:255)
      	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 <0x00000000f9c23bb8> (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 <0x00000000f9c23bb8> (a java.io.InputStreamReader)
      	at java.io.BufferedReader.readLine(BufferedReader.java:389)
      	at com.atlassian.bamboo.process.StreamToBuildLoggerOutputHandler.process(StreamToBuildLoggerOutputHandler.java:60)
      	at com.atlassian.utils.process.PluggableProcessHandler.processError(PluggableProcessHandler.java:119)
      	at com.atlassian.utils.process.ExternalProcessImpl$ErrorHandlerRunnable.process(ExternalProcessImpl.java:731)
      	at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:684)
      	at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:158)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)
      
      "47:StdOutHandler java.lang.ProcessImpl@fb1d545" #47 prio=5 os_prio=0 tid=0x0000000016f20000 nid=0x2f74 runnable [0x000000001cb3e000]
         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 <0x00000000fa21d260> (a java.io.BufferedInputStream)
      	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 <0x00000000fa041208> (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 <0x00000000fa041208> (a java.io.InputStreamReader)
      	at java.io.BufferedReader.readLine(BufferedReader.java:389)
      	at com.atlassian.bamboo.process.StreamToBuildLoggerOutputHandler.process(StreamToBuildLoggerOutputHandler.java:60)
      	at com.atlassian.utils.process.PluggableProcessHandler.processOutput(PluggableProcessHandler.java:127)
      	at com.atlassian.utils.process.ExternalProcessImpl$OutputHandlerRunnable.process(ExternalProcessImpl.java:771)
      	at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:684)
      	at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:158)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)
      

      If the build is force stopped via UI, the logs will display this message before stopping the build:

      INFO   | jvm 2    | 2017/07/20 13:37:19 | 2017-07-20 13:37:19,581 WARN [0-BAM::imednowvm10dev::Agent:pool-3-thread-1] [LatchedRunnable] Interrupted waiting for ExternalProcess pump to complete
      

      Workaround

      If affecting a Gradle build, use the Gradle --no-daemon flag.

              Unassigned Unassigned
              jowen@atlassian.com Jeremy Owen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: