mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4886 - think the sync on shutdown issue is resolved and the test will no longer hang
This commit is contained in:
parent
cbb46ea7d3
commit
cb6941ee0b
|
@ -979,11 +979,18 @@ class LevelDBClient(store: LevelDBStore) {
|
|||
ingorefailure(might_fail(throw new IOException("non-clean close")))
|
||||
}
|
||||
|
||||
def stop():Unit = this.synchronized {
|
||||
if( writeExecutor!=null ) {
|
||||
writeExecutor.shutdown
|
||||
writeExecutor.awaitTermination(60, TimeUnit.SECONDS)
|
||||
writeExecutor = null
|
||||
def stop():Unit = {
|
||||
var executorToShutdown:ExecutorService = null
|
||||
this synchronized {
|
||||
if (writeExecutor != null) {
|
||||
executorToShutdown = writeExecutor
|
||||
writeExecutor = null
|
||||
}
|
||||
}
|
||||
|
||||
if (executorToShutdown != null) {
|
||||
executorToShutdown.shutdown
|
||||
executorToShutdown.awaitTermination(60, TimeUnit.SECONDS)
|
||||
|
||||
// this blocks until all io completes..
|
||||
snapshotRwLock.writeLock().lock()
|
||||
|
|
|
@ -522,14 +522,11 @@ public class AMQ2149Test {
|
|||
final long expiry = System.currentTimeMillis() + 1000 * 60 * 4;
|
||||
while(!threads.isEmpty() && exceptions.isEmpty() && System.currentTimeMillis() < expiry) {
|
||||
Thread sendThread = threads.firstElement();
|
||||
sendThread.join(1000*20);
|
||||
sendThread.join(1000*30);
|
||||
if (!sendThread.isAlive()) {
|
||||
threads.remove(sendThread);
|
||||
} else {
|
||||
Throwable throwable = new Throwable("blocked send thread");
|
||||
throwable.setStackTrace(sendThread.getStackTrace());
|
||||
LOG.error("Send thread blocked", throwable);
|
||||
throwable.printStackTrace();
|
||||
AutoFailTestSupport.dumpAllThreads("Send blocked");
|
||||
}
|
||||
}
|
||||
LOG.info("senders done..." + threads);
|
||||
|
|
Loading…
Reference in New Issue