[
https://issues.apache.org/jira/browse/ARTEMIS-2664?focusedWorklogId=405372&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-405372
]
ASF GitHub Bot logged work on ARTEMIS-2664:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Mar/20 11:58
Start Date: 18/Mar/20 11:58
Worklog Time Spent: 10m
Work Description: brusdev commented on pull request #3024: ARTEMIS-2664
The prefetch size is exceeded after delivered acks
URL: https://github.com/apache/activemq-artemis/pull/3024#discussion_r394293157
##########
File path:
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
##########
@@ -305,8 +306,20 @@ public void acknowledge(MessageAck ack) throws Exception {
List<MessageReference> ackList =
serverConsumer.getDeliveringReferencesBasedOnProtocol(removeReferences, first,
last);
if (removeReferences && (ack.isIndividualAck() || ack.isStandardAck() ||
ack.isPoisonAck())) {
- acquireCredit(ackList.size());
+ this.deliveredAcks.getAndUpdate(deliveredAcks -> {
+ if (deliveredAcks >= ackList.size()) {
+ return deliveredAcks - ackList.size();
+ }
+
+ acquireCredit(ackList.size() - deliveredAcks);
Review comment:
It is dangerous to call acquireCredit inside the deliveredAcks update
because it could be executed multiple times. I created the PR #3029 to fix this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 405372)
Time Spent: 1h (was: 50m)
> The prefetch size is exceeded after delivered acks
> --------------------------------------------------
>
> Key: ARTEMIS-2664
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2664
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Domenico Bruscino
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> In an environment using OpenWire clients, after the consumer send delivered
> acks, we see that messages get prefetched out to the consumer beyond its
> limit.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)