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

ASF GitHub Bot logged work on ARTEMIS-4206:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Mar/23 23:55
            Start Date: 28/Mar/23 23:55
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4418:
URL: https://github.com/apache/activemq-artemis/pull/4418#discussion_r1151264320


##########
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessage.java:
##########
@@ -49,6 +76,28 @@ public int getDurableCount() {
       return DURABLE_REF_COUNT_UPDATER.get(this);
    }
 
+   /** Sub classes may mark fired=true when they were explicitly called.
+    * E.g large message removed the file upon cancellation */
+   protected void markFired() {
+      fired = true;
+      if (firedAtomic != null) {
+         firedAtomic.set(true);
+      }
+   }
+
+   public RefCountMessage() {
+      if (DEBUG_REF_COUNT) {
+         AtomicBoolean refFired = this.firedAtomic;
+         List<Exception> crumbs = debugCrumbs;
+         crumbs.add(new Exception("new Instance"));
+         String clazz = this.getClass().getName();
+         // notice you can't have a direct reference on the LargeMessage 
Itself,
+         // Otherwise you would get a leak from itself
+         // RefCountMessageLeakTest is validating this scenario
+         CLEANER.register(this, () -> debug(clazz, refFired, crumbs));

Review Comment:
   I actually amended this with a State Object.



##########
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Test.java:
##########


Review Comment:
   removed... it was a mistake.





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

    Worklog Id:     (was: 853535)
    Time Spent: 40m  (was: 0.5h)

> Unreferenced AMQP Large Messages are not removed
> ------------------------------------------------
>
>                 Key: ARTEMIS-4206
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4206
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.29.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Say you crashed the server after the ack, and before the file.remove, and the 
> journal. record removal.
> The AMQP Large Message may not be removed right away, requiring a restart of 
> the broker.
> At this point this is really caused by ARTEMIS-4193  and only affected 2.29.0 
> and no previous versions



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to