[
https://issues.apache.org/jira/browse/ARTEMIS-2371?focusedWorklogId=256897&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-256897
]
ASF GitHub Bot logged work on ARTEMIS-2371:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 10/Jun/19 15:29
Start Date: 10/Jun/19 15:29
Worklog Time Spent: 10m
Work Description: brusdev commented on pull request #2694: ARTEMIS-2371
Message with huge header shuts broker down
URL: https://github.com/apache/activemq-artemis/pull/2694#discussion_r292061972
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java
##########
@@ -265,6 +266,51 @@ public void testSendAMQPReceiveAMQPViaJMSBytes() throws
Exception {
return payload;
}
+ @Test(timeout = 60000)
+ public void testSendHugeHeader() throws Exception {
+ doTestSendHugeHeader(PAYLOAD);
+ }
+
+ @Test(timeout = 60000)
+ public void testSendLargeMessageWithHugeHeader() throws Exception {
+ doTestSendHugeHeader(1024 * 1024);
+ }
+
+ public void doTestSendHugeHeader(int expectedSize) throws Exception {
+ server.getAddressSettingsRepository().addMatch("#", new
AddressSettings().setDefaultAddressRoutingType(RoutingType.ANYCAST));
+
+ AmqpClient client = createAmqpClient();
+ AmqpConnection connection = addConnection(client.connect());
+ try {
+
+ connection.connect();
+
+ final int strLength = 1024 * 1024;
+ AmqpSession session = connection.createSession();
+ AmqpSender sender = session.createSender(testQueueName);
+
+ AmqpMessage message = createAmqpMessage((byte) 'A', expectedSize);
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < strLength; i++) {
+ buffer.append(" ");
+ }
+ message.setApplicationProperty("str", buffer.toString());
+ message.setDurable(true);
+
+ try {
+ sender.send(message);
+ fail();
+ } catch (IOException e) {
+ Assert.assertTrue(e.getCause() instanceof JMSException);
+ Assert.assertTrue(e.getMessage().contains("larger than the store
maxRecordSize"));
Review comment:
I changed the check to test Exception Code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 256897)
Time Spent: 2h 20m (was: 2h 10m)
> AMQP: message with very large header shuts broker down
> ------------------------------------------------------
>
> Key: ARTEMIS-2371
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2371
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: AMQP, Broker
> Affects Versions: 2.9.0
> Reporter: Domenico Bruscino
> Priority: Major
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> When there is one really large header sent with the message, the broker does
> not have room for it and shuts down. Using an AMQP client send a message with
> an extremely large header (>600000 bytes) and broker default configuration
> this will trigger the following exception:
> {code:java}
> [Thread-0
> (ActiveMQ-IO-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$7@6bbe85a8)]
> 11:01:00,087 WARN [org.apache.activemq.artemis.core.server] AMQ222010:
> Critical IO Error, shutting down the server.
> file=AIOSequentialFile:/home/dbruscin/Workspace/activemq-artemis/tests/integration-tests/./target/tmp/junit9074908614954602801/journal0-L5672/activemq-data-1.amq,
> message=Can't write records (size=2097454) bigger than the
> bufferSize(501760) on the journal: java.lang.IllegalStateException: Can't
> write records (size=2097454) bigger than the bufferSize(501760) on the journal
> at
> org.apache.activemq.artemis.core.io.buffer.TimedBuffer.checkSize(TimedBuffer.java:247)
> [:]
> at
> org.apache.activemq.artemis.core.io.AbstractSequentialFile.fits(AbstractSequentialFile.java:180)
> [:]
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.switchFileIfNecessary(JournalImpl.java:3065)
> [:]
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendRecord(JournalImpl.java:2796)
> [:]
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.access$100(JournalImpl.java:91)
> [:]
> at
> org.apache.activemq.artemis.core.journal.impl.JournalImpl$1.run(JournalImpl.java:852)
> [:]
> at
> org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42)
> [:]
> at
> org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31)
> [:]
> at
> org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:66)
> [:]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [rt.jar:1.8.0_212]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [rt.jar:1.8.0_212]
> at
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
> [:]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)