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

ASF GitHub Bot logged work on ARTEMIS-2926:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Oct/20 13:35
            Start Date: 27/Oct/20 13:35
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on a change in pull request #3287:
URL: https://github.com/apache/activemq-artemis/pull/3287#discussion_r512696109



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java
##########
@@ -265,6 +291,14 @@ public void stop() {
       if (future != null) {
          future.cancel(false);
          future = null;
+         final AtomicBoolean bookedForRunning = this.bookedForRunning;
+         if (bookedForRunning != null) {
+            // this is trying to fast-fail any running task or pending one:
+            bookedForRunning.compareAndSet(false, true);

Review comment:
       > Have you checked if there is there any impact of this behaviour 
change? If not, might it be worth omitting this bit, and just leaving the 
reassignment below for now?
   
   It's the safer choice here so will do as you suggest and simplify the rest 
of the code (although "simplify" is rather optimistic here XD )




----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 505219)
    Time Spent: 1h 40m  (was: 1.5h)

> Scheduled task executions are skipped randomly
> ----------------------------------------------
>
>                 Key: ARTEMIS-2926
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2926
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.13.0
>            Reporter: Apache Dev
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Scheduled tasks extending {{ActiveMQScheduledComponent}} could randomly skip 
> an execution, logging:
> {code}
> Execution ignored due to too many simultaneous executions, probably a 
> previous delayed execution
> {code}
> The problem is in the "ActiveMQScheduledComponent#runForExecutor" Runnable.
> Times to be compared ({{currentTimeMillis()}} and {{lastTime}}) are taken 
> inside the runnable execution itself. So, depending on relative execution 
> times, it could happen that the difference is less than the given period 
> (e.g. 1 ms), resulting in a skipped execution.



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

Reply via email to