mirror of
https://github.com/apache/activemq.git
synced 2025-02-17 07:24:51 +00:00
try and ensure that the brokers shutdown cleanly for the
ReliableReconnectTest - as it can hang git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@603952 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0ac3f165dc
commit
225d2bf055
@ -108,6 +108,7 @@ public class KahaStore implements Store {
|
|||||||
closed = true;
|
closed = true;
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
unlock();
|
unlock();
|
||||||
|
lockFile.close();
|
||||||
|
|
||||||
for (ListContainerImpl container : lists.values()) {
|
for (ListContainerImpl container : lists.values()) {
|
||||||
container.close();
|
container.close();
|
||||||
|
@ -253,11 +253,11 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||||||
if (!started.compareAndSet(true, false)) {
|
if (!started.compareAndSet(true, false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
unlock();
|
||||||
if (lockFile != null) {
|
if (lockFile != null) {
|
||||||
lockFile.close();
|
lockFile.close();
|
||||||
lockFile = null;
|
lockFile = null;
|
||||||
}
|
}
|
||||||
unlock();
|
|
||||||
this.usageManager.getMemoryUsage().removeUsageListener(this);
|
this.usageManager.getMemoryUsage().removeUsageListener(this);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
Scheduler.cancel(periodicCheckpointTask);
|
Scheduler.cancel(periodicCheckpointTask);
|
||||||
@ -890,9 +890,12 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
|
|||||||
if (!disableLocking && (null != lock)) {
|
if (!disableLocking && (null != lock)) {
|
||||||
//clear property doesn't work on some platforms
|
//clear property doesn't work on some platforms
|
||||||
System.getProperties().remove(getPropertyKey());
|
System.getProperties().remove(getPropertyKey());
|
||||||
|
System.clearProperty(getPropertyKey());
|
||||||
|
assert(System.getProperty(getPropertyKey())==null);
|
||||||
if (lock.isValid()) {
|
if (lock.isValid()) {
|
||||||
lock.release();
|
lock.release();
|
||||||
lock.channel().close();
|
lock.channel().close();
|
||||||
|
|
||||||
}
|
}
|
||||||
lock = null;
|
lock = null;
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,12 @@ public class ReliableReconnectTest extends TestSupport {
|
|||||||
topic = true;
|
topic = true;
|
||||||
destination = createDestination(getClass().getName());
|
destination = createDestination(getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void tearDown() throws Exception {
|
||||||
|
if (broker!=null) {
|
||||||
|
broker.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ActiveMQConnectionFactory getConnectionFactory() throws Exception {
|
public ActiveMQConnectionFactory getConnectionFactory() throws Exception {
|
||||||
String url = "failover://" + DEFAULT_BROKER_URL;
|
String url = "failover://" + DEFAULT_BROKER_URL;
|
||||||
@ -77,6 +83,7 @@ public class ReliableReconnectTest extends TestSupport {
|
|||||||
protected void startBroker() throws JMSException {
|
protected void startBroker() throws JMSException {
|
||||||
try {
|
try {
|
||||||
broker = BrokerFactory.createBroker(new URI("broker://()/localhost"));
|
broker = BrokerFactory.createBroker(new URI("broker://()/localhost"));
|
||||||
|
broker.setUseShutdownHook(false);
|
||||||
broker.addConnector(DEFAULT_BROKER_URL);
|
broker.addConnector(DEFAULT_BROKER_URL);
|
||||||
broker.start();
|
broker.start();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user