mirror of
https://github.com/apache/activemq.git
synced 2025-02-09 03:25:33 +00:00
some minor tweaks to the slow ack abort strategy, wasn't always kicking in when it should have.
This commit is contained in:
parent
8276676469
commit
272de3a146
@ -107,6 +107,10 @@ public class AbortSlowAckConsumerStrategy extends AbortSlowConsumerStrategy {
|
|||||||
// Not considered Idle so ensure its cleared from the list
|
// Not considered Idle so ensure its cleared from the list
|
||||||
if (slowConsumers.remove(subscriber) != null) {
|
if (slowConsumers.remove(subscriber) != null) {
|
||||||
LOG.info("sub: {} is no longer slow", subscriber.getConsumerInfo().getConsumerId());
|
LOG.info("sub: {} is no longer slow", subscriber.getConsumerInfo().getConsumerId());
|
||||||
|
} else {
|
||||||
|
if (LOG.isTraceEnabled()) {
|
||||||
|
LOG.trace("Not ignoring idle Consumer {}", subscriber.getConsumerInfo().getConsumerId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,13 +137,25 @@ public class AbortSlowAckConsumerStrategy extends AbortSlowConsumerStrategy {
|
|||||||
private void abortAllQualifiedSlowConsumers() {
|
private void abortAllQualifiedSlowConsumers() {
|
||||||
HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>();
|
HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>();
|
||||||
for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) {
|
for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) {
|
||||||
if (entry.getKey().isSlowConsumer()) {
|
|
||||||
if (getMaxSlowDuration() > 0 &&
|
if (getMaxSlowDuration() > 0 &&
|
||||||
(entry.getValue().markCount * getCheckPeriod() > getMaxSlowDuration()) ||
|
(entry.getValue().markCount * getCheckPeriod() > getMaxSlowDuration()) ||
|
||||||
getMaxSlowCount() > 0 && entry.getValue().slowCount > getMaxSlowCount()) {
|
getMaxSlowCount() > 0 && entry.getValue().slowCount > getMaxSlowCount()) {
|
||||||
|
|
||||||
|
if (LOG.isTraceEnabled()) {
|
||||||
|
LOG.trace("Remove consumer {} from slow list: " +
|
||||||
|
"slow duration = " + entry.getValue().markCount * getCheckPeriod() + ", " +
|
||||||
|
"slow count = " + entry.getValue().slowCount,
|
||||||
|
entry.getKey().getConsumerInfo().getConsumerId());
|
||||||
|
}
|
||||||
|
|
||||||
toAbort.put(entry.getKey(), entry.getValue());
|
toAbort.put(entry.getKey(), entry.getValue());
|
||||||
slowConsumers.remove(entry.getKey());
|
slowConsumers.remove(entry.getKey());
|
||||||
|
} else {
|
||||||
|
if (LOG.isTraceEnabled()) {
|
||||||
|
LOG.trace("Not yet time to abot consumer {}: " +
|
||||||
|
"slow duration = " + entry.getValue().markCount * getCheckPeriod() + ", " +
|
||||||
|
"slow count = " + entry.getValue().slowCount,
|
||||||
|
entry.getKey().getConsumerInfo().getConsumerId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user