Repository navigation
Kill the process tree and keep the output on execution timeout - #64
Closed
slachiewicz wants to merge 4 commits into
Closed
slachiewicz wants to merge 4 commits into
slachiewicz wants to merge 4 commits into
Conversation
ProcessHandle is reached by reflection, not from a src/main/java9 class: tests run from target/classes, where multi-release classes are never loaded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On timeout the forked executor now destroys the descendants of the started process before the process itself, and throws
ExecutorTimeoutException, a subclass ofExecutorExceptionthat carries the last 64 KiB of the grabbed STDOUT and STDERR (stdOutTail(),stdErrTail()). The message keeps itsProcess timeout:prefix.Only a tail, because a hung build may have logged far more than should be copied a second time and kept alive with an exception; it is read from the buffer without copying the rest. The grab buffer itself stays unbounded, as before; a caller that needs all of the output passes its own
stdOut()/stdErr().ProcessHandleis called by reflection rather than fromsrc/main/java9: tests and other exploded class paths load fromtarget/classes, where multi-release classes are never used. On Java 8 only the process itself is destroyed, as before.Fixes #48
Fixes #58
Verified: with
process.destroyForcibly()restored,timeoutDestroysTheProcessTreefails (the grandchild's heartbeat file grows from 92 to 110 bytes after the exception); with the whole buffer kept,timeoutKeepsOnlyTheTailOfLargeOutputfails with a 10,488,916-character tail.Not run on Windows, where the started process is the
cmd.exerunningmvn.cmd; CI covers it.