[ 
https://issues.apache.org/jira/browse/AMQ-9726?focusedWorklogId=971868&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-971868
 ]

ASF GitHub Bot logged work on AMQ-9726:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Jun/25 21:44
            Start Date: 04/Jun/25 21:44
    Worklog Time Spent: 10m 
      Work Description: cshannon opened a new pull request, #1452:
URL: https://github.com/apache/activemq/pull/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.




Issue Time Tracking
-------------------

            Worklog Id:     (was: 971868)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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: 10m
>  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


Reply via email to