You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "clebert suconic (JIRA)" <ji...@apache.org> on 2016/09/20 17:29:21 UTC

[jira] [Comment Edited] (AMQ-5129) Substitute TimeTask with ScheduledExecutorService in org.apache.activemq.thread.Scheduler

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

clebert suconic edited comment on AMQ-5129 at 9/20/16 5:28 PM:
---------------------------------------------------------------

1966? :)

if you change anything here.. look at a simple class I made on Artemis: 

https://github.com/apache/activemq-artemis/blob/master/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java


It's a common pattern that makes it easier to manage. Also this is backed by an executor, so if a Scheduler ever hungs it wouldn't starve the Scheduler... But I also have the OrderedExecutor there, what makes it simpler.


was (Author: clebertsuconic):
1966?

if you change anything here.. look at a simple class I made on Artemis: 

https://github.com/apache/activemq-artemis/blob/master/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java


It's a common pattern that makes it easier to manage. Also this is backed by an executor, so if a Scheduler ever hungs it wouldn't starve the Scheduler... But I also have the OrderedExecutor there, what makes it simpler.

> Substitute TimeTask with ScheduledExecutorService in org.apache.activemq.thread.Scheduler
> -----------------------------------------------------------------------------------------
>
>                 Key: AMQ-5129
>                 URL: https://issues.apache.org/jira/browse/AMQ-5129
>             Project: ActiveMQ
>          Issue Type: Wish
>    Affects Versions: 5.9.0
>            Reporter: matteo rulli
>         Attachments: proposed-patch.txt
>
>
> Since Timer has only one execution thread, long-running task can affect other scheduled tasks. Besides, runtime exceptions thrown in TimerTasks kill the only one running thread, bringing down the entire Scheduler.
> I have the suspect that all this could relate to AMQ-3938: sometimes in very busy environments I experience exaclty the same problem: a slow leakeage due to temp queues that are not deleted. Since org.apache.activemq.broker.region.RegionBroker uses a Scheduler to activate the purgeInactiveDestinations, a crashed timer could explain why purgeInactiveDestinations stops working.
> I attached a tentative patch to migrate timer to ScheduledExecutorService. Hope this helps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)