ARTEMIS-3084 Small tweak. Log a Thread dump if a server.stop cannot get a completion of pending closes

This commit is contained in:
Clebert Suconic 2021-01-27 17:40:10 -05:00
parent 67556034a6
commit 03f8f83935
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,8 @@ package org.apache.activemq.artemis.core.io.aio;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.nio.ByteBuffer;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
@ -303,6 +305,10 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
// if we stop libaioContext before we finish this, we will never get confirmation on items previously sent
if (!pendingClose.await(1, TimeUnit.MINUTES)) {
ActiveMQJournalLogger.LOGGER.warn("Timeout on waiting for asynchronous close");
final ThreadInfo[] threads = ManagementFactory.getThreadMXBean().dumpAllThreads(true, true);
for (ThreadInfo threadInfo : threads) {
ActiveMQJournalLogger.LOGGER.warn(threadInfo.toString());
}
}
} catch (Throwable throwableToLog) {
logger.warn(throwableToLog.getMessage(), throwableToLog);