You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/10/27 08:43:51 UTC

[GitHub] [activemq-artemis] franz1981 commented on pull request #3287: ARTEMIS-2926 Scheduled task executions are skipped randomly

franz1981 commented on pull request #3287:
URL: https://github.com/apache/activemq-artemis/pull/3287#issuecomment-717082441


   @gemmellr 
   
   A couple of observations on the changes on be3c193 on https://github.com/apache/activemq-artemis/blob/be3c193f73775b961f855e6d935c442e28a14875/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java#L324-L331
   I've chosen on purpose to allow a racing booking request (can be either from a `delay` or the next periodic task submission on `executor`) to happen before instead of on completion of `ActiveMQScheduledComponent.this.run()`:
   
   - because of the expected behaviour of `delay`: 
   eg `JDBCJournalImpl` submit some records and call `syncTimer.delay()`; it means that if a pending task hasn't yet hit`bookedForRunning.compareAndSet(true, false)`, the delay request will fail, leaving some records to not be picked up and processed later
   - because of the uselessness (due to how a JVM work?) to detect a "slow" (ie which execution time is > period) pending task (see https://issues.apache.org/jira/browse/ARTEMIS-2926?focusedCommentId=17212908&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17212908): TLDR if `bookedForRunning.compareAndSet(true, false)` takes long time to be hit it doesn't mean that the task hasn't been prompty executed/is slow -> skipping the next period task just means we're slowing down rate!


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