You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Chris Hofstaedter <ch...@nmwco.com> on 2007/01/04 16:43:00 UTC

dangling thread after shutdown broker with a managed transport

I ran into a problem in which I end up with an orphaned thread every
time I bounce a broker with a managed transport.  I realize this may not
be a big deal in many scenarios, but we may end up bouncing our broker
everytime a user changes some configuration settings in our application
and we need the app to run indefinitely.  So orphaned threads are a
concern to me.
 
I traced it down to BrokerService.startTransportConnector().
 
In this function, if isUseJmx() returns true, the connector is
decorated/replaced through a call to connector.asManagedConnector().
Turns out the broker never stores the reference to the newly created
managed connector anywhere.  I added transportConnectors.add(connector)
to add the new managed connector to the broker's container of connectors
and it seems to work in that all threads are shutdown cleanly even when
the transport connector is managed.
 
Does this seem like a reasonable change and should I create a JIRA to
capture the change?

RE: dangling thread after shutdown broker with a managed transport

Posted by Chris Hofstaedter <ch...@nmwco.com>.
Created AMQ-1118

-----Original Message-----
From: Chris Hofstaedter [mailto:chrish@nmwco.com] 
Sent: Thursday, January 04, 2007 10:43 AM
To: activemq-users@geronimo.apache.org
Subject: dangling thread after shutdown broker with a managed transport

I ran into a problem in which I end up with an orphaned thread every
time I bounce a broker with a managed transport.  I realize this may not
be a big deal in many scenarios, but we may end up bouncing our broker
everytime a user changes some configuration settings in our application
and we need the app to run indefinitely.  So orphaned threads are a
concern to me.
 
I traced it down to BrokerService.startTransportConnector().
 
In this function, if isUseJmx() returns true, the connector is
decorated/replaced through a call to connector.asManagedConnector().
Turns out the broker never stores the reference to the newly created
managed connector anywhere.  I added transportConnectors.add(connector)
to add the new managed connector to the broker's container of connectors
and it seems to work in that all threads are shutdown cleanly even when
the transport connector is managed.
 
Does this seem like a reasonable change and should I create a JIRA to
capture the change?