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

Chris M. Hostetter commented on SOLR-15819:
-------------------------------------------

I am not very familiar with how the circut breakers work, or how this test is 
designed, but the first thing that jumps out at me when glancing at the test is 
that i see no reason why {{testResponseWithCBTiming}} should even need/want a 
memory based breaker in effect.

I see the test establishes some {{MockCircuitBreaker}} and 
{{FakeMemoryPressureCircuitBreaker}} classes that are used in test methods 
where they attempt to test memory based protection -- but there is also an 
{{@After}} method to clean these up (allthough i'm not clear why this after 
method uses different code then a similar looking 
{{removeAllExistingCircuitBreakers()}} helper method that some test methods 
use...

{code}
  @After
  public void after() {
    h.getCore().getCircuitBreakerManager().deregisterAll();
  }
//...
  private void removeAllExistingCircuitBreakers() {
    List<CircuitBreaker> registeredCircuitBreakers = 
h.getCore().getCircuitBreakerManager().getRegisteredCircuitBreakers();

    registeredCircuitBreakers.clear();
  }
{code}

I suspect the root cause of these spurious failures  is that the 
{{solrconfig-memory-circuitbreaker.xml}} used by the test defines a "real" (i 
think?) memory circut breaker...

{noformat}
  <circuitBreaker class="solr.CircuitBreakerManager" enabled="true">
    <str name="memEnabled">true</str>
    <str name="memThreshold">75</str>
    <str name="cpuEnabled">true</str>
    <str name="cpuThreshold">75</str>
  </circuitBreaker>
{noformat}

...so if {{TestCircuitBreaker.testResponseWithCBTiming}} is the first test run, 
and if *lots* of tests have run in that JVM making the memory usage high, then 
that breaker will trip long before either of the above methods have been called 
by any other test code to {{deregisterAll();}} or {{.clear();}} those breakers.

[~atris] - can you please take a look at this?

> spurious failures from TestCircuitBreaker.testResponseWithCBTiming
> ------------------------------------------------------------------
>
>                 Key: SOLR-15819
>                 URL: https://issues.apache.org/jira/browse/SOLR-15819
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Priority: Major
>
> As seen in both jenkins runs and locally on my machine, 
> {{TestCircuitBreaker.testResponseWithCBTiming}} can fail in non-reproducible 
> ways due to "Circuit Breakers tripped Memory Circuit Breaker triggered as JVM 
> heap usage values are greater than allocated threshold.Seen JVM heap memory 
> usage 424442256 and allocated threshold 402653184"



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to