[ https://issues.apache.org/jira/browse/ARTEMIS-2926?focusedWorklogId=505217&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-505217 ]
ASF GitHub Bot logged work on ARTEMIS-2926: ------------------------------------------- Author: ASF GitHub Bot Created on: 27/Oct/20 13:33 Start Date: 27/Oct/20 13:33 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_r512694529 ########## File path: artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java ########## @@ -60,41 +58,58 @@ * @param checkPeriod the delay between the termination of one execution and the start of the next * @param timeUnit the time unit of the {@code initialDelay} and {@code checkPeriod} parameters * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} otherwise + * @param overBooking if {@code true} {@link #delay()} executions and period ones are allowed to accumulate, {@code false} otherwise. Default is {@code false}. */ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, Executor executor, long initialDelay, long checkPeriod, TimeUnit timeUnit, - boolean onDemand) { + boolean onDemand, + boolean overBooking) { Review comment: > I would remove the overbooking, eliminate the possibility of null for the atomic, and simplify the rest of the code accordingly. It will still be plenty complicated :) +100 agree: I was thinking that was needed for the JDBC lease lock, but effectively isn't needed, I'm removing 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 505217) Time Spent: 1h 20m (was: 1h 10m) > 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 20m > 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)