You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/23 15:48:00 UTC

[jira] [Work logged] (CAMEL-14428) Terminate the JVM for OutOfMemoryError when running tests

     [ https://issues.apache.org/jira/browse/CAMEL-14428?focusedWorklogId=376309&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-376309 ]

ASF GitHub Bot logged work on CAMEL-14428:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Jan/20 15:47
            Start Date: 23/Jan/20 15:47
    Worklog Time Spent: 10m 
      Work Description: zregvart commented on pull request #3509: CAMEL-14428: add `-XX:+ExitOnOutOfMemoryError` to surefire
URL: https://github.com/apache/camel/pull/3509
 
 
   This configures `-XX:+ExitOnOutOfMemoryError` for JVM spun by Maven
   Surefire plugin. So now when JVM launched by Surefire signals
   `OutOfMemoryError` it will abruptly exit the JVM, skipping any failing
   test rerun and it will not generate the JUnit XML/TXT report.
   
   Instead `target/surefire-reports/*.dumpstream` needs to be consulted to
   find errors like:
   
   ```
   # Created at 2020-01-23T16:30:48.519
   Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'Terminating due to java.lang.OutOfMemoryError: Java heap space'.
   ```
   
   So the downside of this is that troubleshooting test issues when
   `OutOfMemoryError` occurs is more difficult; the plugin stops executing
   and fails the module build with:
   
   ```
   [ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
   ```
   
   Newer version of Surefire include additional `[ERROR]` lines that help
   with pinpointing the issue somewhat, though, I assume, it will come as a
   surprise for someone not expecting this.
   
   Having JVM exit and not retry the test in a situation where we're
   starved for memory enables us to fail fast and not consume any more
   shared resources.
   
   Note that on the Jenkins the build is run with `-fae`, meaning that
   Maven will fail only after it is unable to proceed due to required
   modules not being able to build. With that a OOM in a module built in
   the middle of the build will not prevent the build from proceeding to
   build other module (that do not depend on it).
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 376309)
    Remaining Estimate: 0h
            Time Spent: 10m

> Terminate the JVM for OutOfMemoryError when running tests
> ---------------------------------------------------------
>
>                 Key: CAMEL-14428
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14428
>             Project: Camel
>          Issue Type: Improvement
>          Components: build system
>            Reporter: Zoran Regvart
>            Assignee: Zoran Regvart
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When the tests run and they run out of memory we should terminate the JVM running the tests. The reasoning is that when out of memory issues occur they invalidate any test outcome and having the tests continue to run just prolongs the build and consumes resources.
> Thread on the [dev mailing list|https://lists.apache.org/thread.html/r378b5e4a2d6db4796e43683a57009a0d591a153234deba54d0d285e5%40%3Cdev.camel.apache.org%3E], [build mailing list|https://mail-archives.apache.org/mod_mbox/www-builds/202001.mbox/%3CED76C2EF-1AED-4046-8E6A-427E7B3C1A64%40apache.org%3E], [INFRA issue|https://issues.apache.org/jira/browse/INFRA-19751].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)