maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SUREFIRE-1302) Surefire does not wait long enough for the forked VM and assumes it to be dead
Date Thu, 18 May 2017 17:38:04 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016136#comment-16016136
] 

Tibor Digana edited comment on SUREFIRE-1302 at 5/18/17 5:37 PM:
-----------------------------------------------------------------

[~opeyrusse]
I guess this is 1GB of committed memory: 888M->820M(1024M)
According to my equation 1GB should be 17 seconds. But 12 is less than 17. So the ping should
be tolerant.
Could you please print a log in the ping thread? It should print a message every second.
In other words the ping of 10 seconds should turn to 17 seconds when committed memory is 1
GB.
Debugging the code would be hard but putting more logs, according to your preference, may
help.


was (Author: tibor17):
[~opeyrusse]
I guess this this 1GB of committed memory: 888M->820M(1024M)
According to my equation 1GB should be 17 seconds. But 12 is less than 17. So the ping should
be tolerant.
Could you please print a log in the ping thread? It should print a message every second.
In other words the ping of 10 seconds should turn to 17 seconds when committed memory is 1
GB.
Debugging the code would be hard but putting more logs, according to your preference, may
help.

> Surefire does not wait long enough for the forked VM and assumes it to be dead
> ------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1302
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1302
>             Project: Maven Surefire
>          Issue Type: Request
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.19.1
>            Reporter: Yuriy Zaplavnov
>            Assignee: Tibor Digana
>             Fix For: 2.20.1
>
>         Attachments: 2017-05-18T05-48-08_685-jvmRun1.dumpstream, surefire-logs, surefire-tests-terminated-master-aa9330316038f6b46316ce36ff40714ffc7cf299.zip,
tests_log_01.txt, tests_log_02.txt
>
>
> This issue happens because surefire kills the forked container if it times out waiting
for the 'ping'.
> In org.apache.maven.surefire.booter.ForkedBooter class there is hardcoded constant PING_TIMEOUT_IN_SECONDS
 = 20 which is used in the following method:
> {code}
> private static ScheduledFuture<?> listenToShutdownCommands( CommandReader reader
)
>     {
>         reader.addShutdownListener( createExitHandler( reader ) );
>         AtomicBoolean pingDone = new AtomicBoolean( true );
>         reader.addNoopListener( createPingHandler( pingDone ) );
>         return JVM_TERMINATOR.scheduleAtFixedRate( createPingJob( pingDone, reader ),
>                                                    0,PING_TIMEOUT_IN_SECONDS, SECONDS
);
>     }
> {code}
> to create ScheduledFuture.
> In some of the cases the forked container might respond a bit later than it's expected
and surefire kills it
> {code}
> private static Runnable createPingJob( final AtomicBoolean pingDone, final CommandReader
reader  )
>     {
>         return new Runnable()
>         {
>             public void run()
>             {
>                 boolean hasPing = pingDone.getAndSet( false );
>                 if ( !hasPing )
>                 {
>                     exit( 1, KILL, reader, true );
>                 }
>             }
>         };
>     }
> {code}
> As long as we need to terminate it anyway, It would be really helpful if the problem
could be solved making the PING_TIMEOUT_IN_SECONDS  configurable with the ability to specify
the value from maven-surefire-plugin. 
> It would help to configure this timeout based on needs and factors of the projects where
surefire runs.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message