mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4930 tracked hung org.apache.activemq.usecases.ExpiredMessagesWithNoConsumerTest#testExpiredMessagesWithNoConsumer - when using lower -Xmx than maven run - looping on browse due to no page when hasSpace fails. Browse picks up this state now
This commit is contained in:
parent
128921e687
commit
9c24716044
|
@ -1230,15 +1230,17 @@ public class Queue extends BaseDestination implements Task, UsageListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldPageInMoreForBrowse(int max) {
|
private boolean shouldPageInMoreForBrowse(int max) {
|
||||||
|
int alreadyPagedIn = 0;
|
||||||
pagedInMessagesLock.readLock().lock();
|
pagedInMessagesLock.readLock().lock();
|
||||||
try {
|
try {
|
||||||
int alreadyPagedIn = pagedInMessages.size();
|
alreadyPagedIn = pagedInMessages.size();
|
||||||
return alreadyPagedIn < max
|
|
||||||
&& alreadyPagedIn < getDestinationStatistics().getMessages().getCount()
|
|
||||||
&& !memoryUsage.isFull(110);
|
|
||||||
} finally {
|
} finally {
|
||||||
pagedInMessagesLock.readLock().unlock();
|
pagedInMessagesLock.readLock().unlock();
|
||||||
}
|
}
|
||||||
|
LOG.trace("max {}, alreadyPagedIn {}, messagesCount {}, memoryUsage {}%", new Object[]{max, alreadyPagedIn, destinationStatistics.getMessages().getCount(), memoryUsage.getPercentUsage()});
|
||||||
|
return (alreadyPagedIn < max)
|
||||||
|
&& (alreadyPagedIn < destinationStatistics.getMessages().getCount())
|
||||||
|
&& messages.hasSpace();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAll(Collection<? extends MessageReference> refs, List<Message> l, int max,
|
private void addAll(Collection<? extends MessageReference> refs, List<Message> l, int max,
|
||||||
|
|
Loading…
Reference in New Issue