This commit is contained in:
Clebert Suconic 2019-11-22 10:10:17 -05:00
commit 6c33a48c15
1 changed files with 46 additions and 41 deletions

View File

@ -2969,6 +2969,11 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
private void depage(final boolean scheduleExpiry) {
depagePending = false;
if (!depageLock.tryLock()) {
return;
}
try {
synchronized (this) {
if (isPaused() || pageIterator == null) {
return;
@ -3023,6 +3028,9 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
// This will just call an executor
expireReferences();
}
} finally {
depageLock.unlock();
}
}
private void internalAddRedistributor(final ArtemisExecutor executor) {
@ -3888,13 +3896,10 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
@Override
public void run() {
depageLock.lock();
try {
depage(scheduleExpiry);
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.errorDelivering(e);
} finally {
depageLock.unlock();
}
}
}