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

Achim Hügen commented on ARTEMIS-3587:
--------------------------------------

Same issue here and I finally spotted the reason. There is a race condition in 
CriticalMeasure#checkExpiration that was introduced with ARTEMIS-3271. Notice 
how the calculation of "expired" uses the instance field "timeEnter" where it 
clearly should use the local variable "thisTimeEnter", because "timeEnter" 
might have been reset to 0 by another thread after it was read the first time: 

{code}
   public boolean checkExpiration(long timeout, boolean reset) {
      final long {color:#0747A6}thisTimeEnter {color}= this.timeEnter;
      if ({color:#0747A6}thisTimeEnter {color}!= 0L) {
         long time = System.nanoTime();
         boolean expired = time - {color:red}timeEnter{color} > timeout;
{code}

> After upgrade: AMQ224107: The Critical Analyzer detected slow paths on the 
> broker.
> ----------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3587
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3587
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.19.0
>            Reporter: Sebastian T
>            Priority: Major
>              Labels: performance
>         Attachments: log_with_stacktrace.log
>
>
> After upgrading from Artemis 2.16.0 to 2.19.0 we now receive the following 
> message a few times a day:
> 2021-11-05 05:32:53.641 WARN 3850 --- [eduled-threads)] 
> o.a.a.a.u.c.CriticalMeasure              : Component 
> org.apache.activemq.artemis.core.server.impl.QueueImpl is expired on path 4
> 2021-11-05 05:32:53.642 INFO 3850 --- [eduled-threads)] o.a.a.a.c.server      
>                    : AMQ224107: The Critical Analyzer detected slow paths on 
> the broker.  It is recommended that you enable trace logs on 
> org.apache.activemq.artemis.utils.critical while you troubleshoot this issue. 
> You should disable the trace logs when you have finished troubleshooting.
> This message is also logged via ActiveMQServerCriticalPlugin#criticalFailure 
> however the javadoc says: "This will be called before the broker is stopped." 
> The broker however is not stopped. So I think the javadoc and the behaviour 
> of the callback are not in line anymore too.



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

Reply via email to