activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (AMQ-5265) JMX destination entires fail due to race condition in MBeanBridgeDestination
Date Sun, 14 Jun 2015 19:17:00 GMT


ASF GitHub Bot commented on AMQ-5265:

GitHub user Hauenstein opened a pull request:

    This is a revision of AMQ-5265 -- the original fix didn't quite clean up all of the mbeans
that MBeanBridgeDestination created, as [noted in the original issue by Tarek Hammoud](
 The key for the map used to track the ObjectNames was an ActiveMQDestination (which uses
the destination's physical name for its equals() implementation) caused the inbound and outbound
entries in the map to randomly replace each other.
    Like Tarek, I could reproduce this issue using 5.11.1 with two networked brokers (full
duplex) with a client publishing to a topic.  After I restart a broker, the logs on the non-restarted
broker show the MBeanBridgeDestination reporting many InstanceAlreadyExistsExceptions when
trying to register the unintentionally-duplicated mbeans.
    Please let me know if this makes sense or if there are any changes you would suggest (ex:
is there a reasonable way or an example I could follow to add a unit test for something like
this?).  Thanks!

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #114
commit 139916e3eee1b60992e13657069358186e57247f
Author: L. Hauenstein <>
Date:   2015-06-11T18:34:28Z
    Revision of AMQ-5265 - fixed the map that tracks
    MBeanBridgeDestination's registered mbeans so that it cleans itself up
    correctly when stopped.


> JMX destination entires fail due to race condition in MBeanBridgeDestination
> ----------------------------------------------------------------------------
>                 Key: AMQ-5265
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.9.1, 5.10.0
>            Reporter: Jeff Genender
>            Assignee: Dejan Bosanac
>             Fix For: 5.10.1, 5.11.0
>         Attachments: AMQ-5265.patch, activemq.patch
> JMX statistics on destinations creates a race condition in the MBeanBridgeDestination's
onInboundMessage, onOutboundMessage, and the purgeInactiveDestinationView task.  If the task
fires and removes the objectName while the onInboundMessage or onOutboundMessage fires, it
will spit out warnings of it already being created if multiple threads are running.  The fix
is to properly synchronize in the purgeInactiveDestinationView and also be sure it cleans
up itself in the destinationObjectNameMap.
> Patch is attached as is a git pull request (for whatever is easier)

This message was sent by Atlassian JIRA

View raw message