[activemq-artemis] branch master updated: ARTEMIS-2951 Fixing Large Message reference counting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[activemq-artemis] branch master updated: ARTEMIS-2951 Fixing Large Message reference counting

clebertsuconic-2
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 621b845  ARTEMIS-2951 Fixing Large Message reference counting
     new 5b20f71  This closes #3304
621b845 is described below

commit 621b845d1675941dea01dbe6aa26b3621fc25cc4
Author: Clebert Suconic <[hidden email]>
AuthorDate: Wed Oct 14 16:40:53 2020 -0400

    ARTEMIS-2951 Fixing Large Message reference counting
---
 .../core/persistence/impl/journal/AbstractJournalStorageManager.java | 2 +-
 .../apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
index 5598465..1cb39ab 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java
@@ -1232,7 +1232,7 @@ public abstract class AbstractJournalStorageManager extends CriticalComponentImp
          }
 
          for (LargeServerMessage msg : largeMessages) {
-            if (msg.toMessage().getRefCount() == 0) {
+            if (msg.toMessage().getRefCount() == 0 && msg.toMessage().getDurableCount() == 0) {
                ActiveMQServerLogger.LOGGER.largeMessageWithNoRef(msg.getMessageID());
                msg.toMessage().usageDown();
             }
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
index 35a90e8..9ed8e2b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
@@ -467,11 +467,6 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
             }
 
             if (preAcknowledge) {
-               if (message.isLargeMessage()) {
-                  // we must hold one reference, or the file will be deleted before it could be delivered
-                  ((LargeServerMessage) message).toMessage().usageUp();
-               }
-
                // With pre-ack, we ack *before* sending to the client
                ref.getQueue().acknowledge(ref, this);
                acks++;