You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Gary Tully (Assigned) (JIRA)" <ji...@apache.org> on 2012/02/23 18:10:48 UTC

[jira] [Assigned] (AMQ-3737) Possible leak in ManangedRegionBroker unregisterDestination

     [ https://issues.apache.org/jira/browse/AMQ-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reassigned AMQ-3737:
-------------------------------

    Assignee: Gary Tully  (was: Timothy Bish)
    
> Possible leak in ManangedRegionBroker unregisterDestination
> -----------------------------------------------------------
>
>                 Key: AMQ-3737
>                 URL: https://issues.apache.org/jira/browse/AMQ-3737
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: 5.5.1
>            Reporter: Timothy Bish
>            Assignee: Gary Tully
>            Priority: Minor
>             Fix For: 5.6.0
>
>
> Method unregisterDestination in ManagedRegionBroker is supposed to remove the SlowConsumerStrategy MBean on the destination it removes if one exists but the code is incorrect and will never actually do so.
> {noformat}
>     protected void unregisterDestination(ObjectName key) throws Exception {
>         DestinationView view = null;
>         removeAndRemember(topics, key, view);
>         removeAndRemember(queues, key, view);
>         removeAndRemember(temporaryQueues, key, view);
>         removeAndRemember(temporaryTopics, key, view);
>         if (registeredMBeans.remove(key)) {
>             try {
>                 managementContext.unregisterMBean(key);
>             } catch (Throwable e) {
>                 LOG.warn("Failed to unregister MBean: " + key);
>                 LOG.debug("Failure reason: " + e, e);
>             }
>         }
>         if (view != null) {
>             key = view.getSlowConsumerStrategy();
>             if (key!= null && registeredMBeans.remove(key)) {
>                 try {
>                     managementContext.unregisterMBean(key);
>                 } catch (Throwable e) {
>                     LOG.warn("Failed to unregister slow consumer strategy MBean: " + key);
>                     LOG.debug("Failure reason: " + e, e);
>                 }
>             }
>         }
>     }
> {noformat}
> Attempts to pass the DestinationView into removeAndRemember() as an 'out' parameter so it never ends up getting set to anything and the last if will never be executed because view will always be null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira