Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15123

Fix FP in CeWorkersTest

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.1
    • Component/s: None
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      This ticket is for fixing

      org.sonarqube.tests.ce.CeWorkersTest#ce_worker_is_resilient_to_OOM_and_RuntimeException_when_starting_or_stopping_analysis_report_container

      which is failing sometimes, making it one of the most annoying false positive.

       

      The issue in this test is that sometimes we are NOT resilient to OOM error. After short investigation it seems that after OOM is thrown HTTP Client that is bundled with Elasticsearch Client is shutdown and can't be used anymore. Here is the stacktrace:

       

      > Caused by: java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED    
      > 	at org.apache.http.util.Asserts.check(Asserts.java:46)    
      > 	at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)    
      > 	at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)    
      > 	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:279)
      

       

      It seems to be related to this issue especially this https://github.com/elastic/elasticsearch/issues/42133#issuecomment-512961627 comment might be of interests to us.

      Since the heap memory is shared by all threads in the JVM, the OOM can in fact affect any thread trying to allocate memory as the memory use approaches the limit. Since we do not have control over all threads (including the aforementioned client), we cannot guarantee resilience against OOM. We'll adapt the test to try to immediately cause an OOM in the test thread, hoping to not affect other threads. If that still results in occasional FPs, the tests should be removed.

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            lukasz.jarocki Łukasz Jarocki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: