[
https://issues.apache.org/jira/browse/AMQ-9726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956319#comment-17956319
]
ASF subversion and git services commented on AMQ-9726:
------------------------------------------------------
Commit 990a8d6bf642331f239dbfc704588cc847f90b3e in activemq's branch
refs/heads/activemq-6.1.x from Christopher L. Shannon
[ https://gitbox.apache.org/repos/asf?p=activemq.git;h=990a8d6bf6 ]
AMQ-9726 - Fix FilePendingMessageCursor clear() method (#1452)
This fixes the clear() method so that when clearing the memory map it
will decrement memory usage, and when clearing the disk list it
will destroy and reset the list for future writes.
(cherry picked from commit b1e8441ca93f0aefa8817c6923cc4741b757da3a)
> Fix FilePendingMessageCursor clear() method
> -------------------------------------------
>
> Key: AMQ-9726
> URL: https://issues.apache.org/jira/browse/AMQ-9726
> Project: ActiveMQ Classic
> Issue Type: Bug
> Affects Versions: 5.19.0, 6.1.6
> Reporter: Christopher L. Shannon
> Assignee: Christopher L. Shannon
> Priority: Major
> Fix For: 6.2.0, 5.19.1, 6.1.7
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The clear() method inside of {{FilePendingMessageCursor}} is supposed to
> clear any messages in memory, as well as clear any messages in the disk
> pending list by destroying it so it can be reset. There are two bugs in this
> method:
> # Clearing the memory list does not iterate and decrement each reference so
> the memory usage tracker is not decremented on clear.
> # When clearing the disk list, the wrong destroy method is used so while the
> list is correctly destroyed and marked as unloaded, the reference is not
> nulled out. This means that any future writes to the cursor will throw an
> exception because the cursor is not loaded. The correct helper method will
> reset this so that future writes will create a list that is correctly
> initialized.
> The bugs here are not showing up with normal usage because the clear() method
> is generally only called when destroying a durable (and there is already code
> to remove the references before calling clear so memory is decremented)
> however because this method is public and could be easily called in the
> future it should be fixed so it works correctly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact