[
https://jira.codehaus.org/browse/SUREFIRE-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=316721#comment-316721
]
Jesse Glick commented on SUREFIRE-946:
--------------------------------------
Seems to happen only when {{reuseForks="true"}}.
Regardless of possible logic errors reading lines that never arrive, the
immediate problem is that shutdown hooks must be very conservative so they are
sure to complete promptly, and {{CommandLineUtils.ProcessHook}} seems to be
deadlocking; it should not call {{Process.destroy}} without a timeout. (It
could fork a thread calling {{destroy}} and wait a second or two for it to
complete, else give up.) I am not sure this shutdown hook is actually necessary
at all—AFAIK Java would destroy the spawned process at shutdown anyway.
Since {{CommandLineUtils}} seems to buggy in this respect, I would recommend
not using it at all. Just use {{ProcessBuilder}} directly.
> Maven hangs on SIGTERM when using Surefire forking
> (CommandLineUtils.ProcessHook)
> ---------------------------------------------------------------------------------
>
> Key: SUREFIRE-946
> URL: https://jira.codehaus.org/browse/SUREFIRE-946
> Project: Maven Surefire
> Issue Type: Bug
> Affects Versions: 2.13
> Reporter: Jesse Glick
> Attachments: stack.txt
>
>
> Java 7u7, Surefire with JUnit {{forkMode="perthread"}} + {{threadCount="1"}}
> + {{reuseForks="true"}}. After pressing Ctrl-C to stop the Maven test run,
> the process hangs and must be killed with SIGKILL. From the thread dump,
> {{CommandLineUtils.ProcessHook}} and {{StreamFeeder}} look responsible.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira