[
https://issues.apache.org/jira/browse/AMQ-6555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15815281#comment-15815281
]
ASF subversion and git services commented on AMQ-6555:
------------------------------------------------------
Commit e4da98bd790566ba2208246541f71a28b4a00c0f in activemq's branch
refs/heads/activemq-5.14.x from [~cshannon]
[ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=e4da98b ]
https://issues.apache.org/jira/browse/AMQ-6555
Fixing Scheduler so that a rescheduled task will first cancel the
existing task so it does not get orphaned from the task map. Also
fixing Topic start so that it will only start once and not twice.
(cherry picked from commit 2769298cf64a10cd74320ad132b3677bac20a6cc)
> Failed to browse topic warnings caused by orphaned expire message tasks in
> Sceduler
> -----------------------------------------------------------------------------------
>
> Key: AMQ-6555
> URL: https://issues.apache.org/jira/browse/AMQ-6555
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.14.1
> Reporter: jack
> Assignee: Christopher L. Shannon
>
> When using a FixedCountSubscriptionRecoveryPolicy on a topic I get millions
> of warnings when the topic is gc'd after inactivity. The impact is that warn
> logging has to be turned off which is not ideal. Looking in detail it seems
> this is caused by a couple of things. Firstly the Topic start method can be
> invoked twice, once when adding the destination to the RegionBroker and
> second when the regionBroker is started.
> That causes the same expireMessagesTask to get scheduled twice which reveals
> the crux of the problem. The Scheduler allows the same task to be scheduled
> again in new TimerTasks, even though it will use the same key and ophan any
> existing (and running) TimerTasks. This is what's happening here. When the
> topic gets stopped, the orphaned tasks continue to run causing these spurious
> warnings that clog up the logs.
> My suggestion would be for the scheduler to check if the task has already
> been registered using a putIfAbsent and fail if it already exists:
> https://github.com/apache/activemq/blob/d9350912984f12356e9d51b0f00b5a28f5cfa58d/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java#L42
> These are the warnings we see:
> 2017-01-10 11:36:13,885 [host] Scheduler] - WARN Topic
> - Failed to browse Topic: myTopic
> java.lang.NullPointerException
> at
> org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy.browse(FixedCountSubscriptionRecoveryPolicy.java:103)
> at
> org.apache.activemq.broker.region.policy.RetainedMessageSubscriptionRecoveryPolicy.browse(RetainedMessageSubscriptionRecoveryPolicy.java:111)
> at org.apache.activemq.broker.region.Topic.doBrowse(Topic.java:677)
> at org.apache.activemq.broker.region.Topic.access$1(Topic.java:639)
> at org.apache.activemq.broker.region.Topic$2.run(Topic.java:791)
> at
> org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
> at java.util.TimerThread.mainLoop(Timer.java:555)
> at java.util.TimerThread.run(Timer.java:505
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)