Skip to content

Commit

Permalink
I'm temporarily reverting "ARTEMIS-4193 Large Message Files orphaned …
Browse files Browse the repository at this point in the history
…after server killed"

while I figure out a better fix

This reverts commit 9f1927d.
  • Loading branch information
clebertsuconic committed Mar 6, 2023
1 parent c2a9ec7 commit 7e6ce5a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,7 @@ public void freeDirectBuffer(ByteBuffer buffer) {
public long storePendingLargeMessage(final long messageID) throws Exception {
try (ArtemisCloseable lock = closeableReadLock()) {
long recordID = generateID();
if (logger.isTraceEnabled()) {
logger.trace("Storing pending large message for messageID={} on recordID={}", messageID, recordID);
}
// the pending record has to be stored and synced before the large message file is created
messageJournal.appendAddRecord(recordID, JournalRecordIds.ADD_LARGE_MESSAGE_PENDING, new PendingLargeMessageEncoding(messageID), true, null);
if (logger.isTraceEnabled()) {
logger.trace("...Stored pending large message for messageID={} on recordID={}", messageID, recordID);
}
messageJournal.appendAddRecord(recordID, JournalRecordIds.ADD_LARGE_MESSAGE_PENDING, new PendingLargeMessageEncoding(messageID), true, getContext(true));

return recordID;
}
Expand Down Expand Up @@ -576,17 +569,17 @@ public LargeServerMessage largeMessageCreated(long id, LargeServerMessage largeM
}
}

// We do this here to avoid a case where the replication gets a list without this file
// to avoid a race
largeMessage.validateFile();

if (largeMessage.toMessage().isDurable()) {
// We store a marker on the journal that the large file is pending
long pendingRecordID = storePendingLargeMessage(id);

largeMessage.setPendingRecordID(pendingRecordID);
}

// the file has to be created after te record is stored
largeMessage.validateFile();


return largeMessage;
}

Expand Down
25 changes: 0 additions & 25 deletions tests/soak-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,31 +247,6 @@
</args>
</configuration>
</execution>
<!-- Used on LargeMessageInterruptTest -->
<execution>
<phase>test-compile</phase>
<id>create-lminterrupt</id>
<goals>
<goal>create</goal>
</goals>
<configuration>
<role>amq</role>
<user>artemis</user>
<password>artemis</password>
<allowAnonymous>true</allowAnonymous>
<noWeb>false</noWeb>
<instance>${basedir}/target/lminterrupt</instance>
<configuration>${basedir}/target/classes/servers/lminterrupt</configuration>
<args>
<arg>--java-options</arg>
<arg>-Djava.rmi.server.hostname=localhost</arg>
<arg>--queues</arg>
<arg>LargeMessageInterruptTest</arg>
<arg>--name</arg>
<arg>lminterrupt</arg>
</args>
</configuration>
</execution>

</executions>
</plugin>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.apache.activemq.artemis.tests.soak;

import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
Expand All @@ -29,11 +28,8 @@
import java.util.HashSet;
import java.util.Set;

import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
import org.apache.activemq.artemis.api.core.management.QueueControl;
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
import org.apache.activemq.artemis.cli.commands.Stop;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
Expand Down Expand Up @@ -156,34 +152,6 @@ protected static ActiveMQServerControl getServerControl(String uri,
throw lastException;
}

protected static QueueControl getQueueControl(String uri,
ObjectNameBuilder builder,
String address,
String queueName,
RoutingType routingType,
long timeout) throws Throwable {
long expireLoop = System.currentTimeMillis() + timeout;
Throwable lastException = null;
do {
try {
JMXConnector connector = newJMXFactory(uri);

ObjectName objectQueueName = builder.getQueueObjectName(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), routingType);

QueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(connector.getMBeanServerConnection(), objectQueueName, QueueControl.class, false);
queueControl.getMessagesAcknowledged(); // making one call
return queueControl;
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
lastException = e;
Thread.sleep(500);
}
}
while (expireLoop > System.currentTimeMillis());

throw lastException;
}

protected static JMXConnector getJmxConnector(String hostname, int port) throws MalformedURLException {
// Without this, the RMI server would bind to the default interface IP (the user's local IP mostly)
System.setProperty("java.rmi.server.hostname", hostname);
Expand Down

This file was deleted.

0 comments on commit 7e6ce5a

Please sign in to comment.