activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AMQ-3737) Possible leak in ManangedRegionBroker unregisterDestination
Date Thu, 23 Feb 2012 17:16:48 GMT

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

Gary Tully resolved AMQ-3737.
-----------------------------

    Resolution: Fixed

fix and test in http://svn.apache.org/viewvc?rev=1292858&view=rev
                
> 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

        

Mime
View raw message