activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <>
Subject Shutdown problem with Master-Slave setup in Karaf/Osgi environment
Date Thu, 16 Feb 2017 16:57:18 GMT
When running multiple brokers in master-slave(s) mode (KahaDB file), they behave as described:

- The first broker grabs the exclusive lock on the file and becomes the master broker. 

- If that broker dies and releases the lock then another broker takes over.
- The slave brokers sit in a loop trying to grab the lock from the master broker.

This is all great, however at shutdown time there is an issue in that the slave brokers
can potentially be still in the call to start(). The starting thread stack looks like:

at java.util.concurrent.TimeUnit.sleep(
at org.apache.activemq.util.ServiceSupport.start(
at org.apache.activemq.util.ServiceSupport.start(
at org.apache.activemq.osgi.ActiveMQServiceFactory.updated(

The Karaf shutdown thread then calls ActiveMQServiceFactory.destroy().
This method and ActiveMQServiceFactory.updated() are synchronized, so things come to a halt.


Hoping anyone may have a workaround?

- Martin

View raw message