lucastetreault commented on PR #908:
URL: https://github.com/apache/activemq/pull/908#issuecomment-1279653855
> In the doStop()-- shouldn't all the cache collections be cleared and not
just the registered mbeans?
>
> If a broker is stopped + started the caches will have previous run data in
them.
>
> ```
> @Override
> protected void doStop(ServiceStopper stopper) {
> super.doStop(stopper);
> // lets remove any mbeans not yet removed
> for (Iterator<ObjectName> iter = registeredMBeans.iterator();
iter.hasNext();) {
> ObjectName name = iter.next();
> try {
> managementContext.unregisterMBean(name);
> } catch (InstanceNotFoundException e) {
> LOG.warn("The MBean {} is no longer registered with JMX",
name);
> } catch (Exception e) {
> stopper.onException(this, e);
> }
> }
> registeredMBeans.clear();
> }
> ```
@mattrpav, you're correct, none of the collections are cleared when the
broker stops. That seems to be the way it has been since about 2006 though. I
think it might be worthwhile to clean up be can probably be done as part of a
separate Jira issue. I can create a task for this if you want.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]