ARTEMIS-2951 Fixing Large Message reference counting

This commit is contained in:
Clebert Suconic 2020-10-14 16:40:53 -04:00
parent 4395a951b5
commit 621b845d16
2 changed files with 1 additions and 6 deletions

View File

@ -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();
}

View File

@ -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++;