You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/06/14 21:17:00 UTC

[jira] [Commented] (AMQ-5265) JMX destination entires fail due to race condition in MBeanBridgeDestination

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

ASF GitHub Bot commented on AMQ-5265:
-------------------------------------

GitHub user Hauenstein opened a pull request:

    https://github.com/apache/activemq/pull/114

    https://issues.apache.org/jira/browse/AMQ-5265

    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](https://issues.apache.org/jira/browse/AMQ-5265?focusedCommentId=14527137&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14527137).  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 https://github.com/Hauenstein/activemq master

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

    https://github.com/apache/activemq/pull/114.patch

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 <lo...@gmail.com>
Date:   2015-06-11T18:34:28Z

    https://issues.apache.org/jira/browse/AMQ-5265
    
    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: https://issues.apache.org/jira/browse/AMQ-5265
>             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
(v6.3.4#6332)