slachiewicz opened a new issue, #58:
URL: https://github.com/apache/maven-executor/issues/58

   ### Affected version
   
   1.0.0
   
   ### Bug description
   
   With `grabOutputAsString(true)` and an `executionTimeout`, 
`ProcessBuilderExecutorSupport` pumps stdout and stderr into two 
`ByteArrayOutputStream`s. When the timeout expires it destroys the process and 
throws `ExecutorException("Process timeout: " + execution)` 
([ProcessBuilderExecutorSupport.java#L93-L96](https://github.com/apache/maven-executor/blob/main/maven-executor/src/main/java/org/apache/maven/executor/support/ProcessBuilderExecutorSupport.java#L93-L96)),
 and both buffers are dropped. The caller learns that the build stalled, but 
not where. Without a timeout the call blocks for as long as the build does, so 
a caller that wants a bounded run cannot also keep the log of a run that hangs.
   
   A hang is the case where an integration-test harness most needs the log. 
Found while moving eclipse-tycho/tycho's integration tests from maven-verifier 
to maven-executor (eclipse-tycho/tycho#6383): one test stalled on a macOS 
runner until GitHub's 6-hour job limit, and nothing shows where. maven-verifier 
1.8.0 wrote the forked build's output to its log file as it arrived, so a 
stalled run still left a partial log.
   
   Proposal: on timeout, throw an exception that carries what was grabbed so 
far, for example an `ExecutorException` subclass with `stdOutString()` and 
`stdErrString()`, or include the tail of the output in the message. Callers 
that pass their own `stdOut()` and `stdErr()` streams instead of grabbing 
already get the partial output, since it is written as it arrives.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to