You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/01/11 21:56:00 UTC
[jira] [Work logged] (ARTEMIS-3636) LinkedListImpl$Iterator leak on mesage consume error
[ https://issues.apache.org/jira/browse/ARTEMIS-3636?focusedWorklogId=707149&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-707149 ]
ASF GitHub Bot logged work on ARTEMIS-3636:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 11/Jan/22 21:55
Start Date: 11/Jan/22 21:55
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on a change in pull request #3911:
URL: https://github.com/apache/activemq-artemis/pull/3911#discussion_r782554568
##########
File path: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
##########
@@ -710,10 +710,8 @@ public void clear(boolean waitForOnMessage) throws ActiveMQException {
synchronized (this) {
// Need to send credits for the messages in the buffer
- Iterator<ClientMessageInternal> iter = buffer.iterator();
-
- while (iter.hasNext()) {
- try {
+ try (LinkedListIterator<ClientMessageInternal> iter = buffer.iterator()) {
Review comment:
Funny! I had the exact same fix on my laptop ready to send a PR for :)
if I merge your PR, it won't even show a difference
--
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.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Issue Time Tracking
-------------------
Worklog Id: (was: 707149)
Remaining Estimate: 0h
Time Spent: 10m
> LinkedListImpl$Iterator leak on mesage consume error
> ----------------------------------------------------
>
> Key: ARTEMIS-3636
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3636
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.19.0
> Reporter: Fabio Nascimento Brandão
> Assignee: Justin Bertram
> Priority: Major
> Fix For: 2.21.0
>
> Attachments: ClientConsumerImplTest.java, production_gc.png, production_heap_dump_wildfly.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> There is a leak of org.apache.activemq.artemis.utils.collections.LinkedListIterator when a message is marked for rollback on consume.
> [https://github.com/apache/activemq-artemis/blob/main/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java#L713]
> The iterator used at ClientConsumerImpl:713 is never closed causing the leak.
>
> I wrote a "unit test" that simulates this condition. Start the test with Xmx256m and after some seconds the program terminates with "OutOfMemoryError".
--
This message was sent by Atlassian Jira
(v8.20.1#820001)