[
https://issues.apache.org/jira/browse/ARTEMIS-3467?focusedWorklogId=648834&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-648834
]
ASF GitHub Bot logged work on ARTEMIS-3467:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 09/Sep/21 19:34
Start Date: 09/Sep/21 19:34
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on a change in pull request
#3732:
URL: https://github.com/apache/activemq-artemis/pull/3732#discussion_r705638271
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
##########
@@ -2738,6 +2749,54 @@ public void testGlobalSizeBytesAndAddressSize(boolean
isPage) throws Exception {
cons.close();
}
+ @Test
+ public void testAMQPLargeMessageFDs() throws Exception {
+ OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
+
+ Assume.assumeTrue(os instanceof UnixOperatingSystemMXBean);
+
+ final SimpleString MY_QUEUE = new SimpleString("MY-QUEUE");
+ final int numberOfMessages = 30;
+ ActiveMQServer server = createServer(true, true);
+
+ server.start();
+
+ long fdBefore =
((UnixOperatingSystemMXBean)os).getOpenFileDescriptorCount();
+
+ server.createQueue(new
QueueConfiguration(MY_QUEUE).setRoutingType(RoutingType.ANYCAST));
+
+ ConnectionFactory connectionFactory =
CFUtil.createConnectionFactory("AMQP", "tcp://localhost:61616");
+ Connection connection = connectionFactory.createConnection();
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+
+ byte[] bufferSample = new byte[300 * 1024];
+
+ for (int i = 0; i < bufferSample.length; i++) {
+ bufferSample[i] = getSamplebyte(i);
+ }
+
+ javax.jms.Queue jmsQueue = session.createQueue(MY_QUEUE.toString());
+
+ MessageProducer producer = session.createProducer(jmsQueue);
+ producer.setTimeToLive(300);
+
+ for (int i = 0; i < numberOfMessages; i++) {
+ BytesMessage message = session.createBytesMessage();
+ message.writeBytes(bufferSample);
+
+ message.setIntProperty("count", i);
+
+ producer.send(message);
+ }
+
+ session.close();
+ connection.close();
+
+ long fdAfter =
((UnixOperatingSystemMXBean)os).getOpenFileDescriptorCount();
Review comment:
```suggestion
Wait.assertEquals(() ->
((UnixOperatingSystemMXBean)os).getOpenFileDescriptorCount() - fdBefore < 3)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 648834)
Remaining Estimate: 0h
Time Spent: 10m
> FD leak on receiving AMQP large messages
> ----------------------------------------
>
> Key: ARTEMIS-3467
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3467
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Domenico Francesco Bruscino
> Assignee: Domenico Francesco Bruscino
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The broker doesn't close all FDs for multiple AMQP large messages received on
> the same session.
> Steps to reproduce:
> {code}
> #create broker instance
> ./bin/artemis create broker --user admin --password admin --require-login
> #run broker instance
> ./broker/bin/artemis run
> lsof -p <BROKER_PID> | wc -l
> #produce 100 large AMQP message
> ./broker/bin/artemis producer --verbose --destination queue://TEST.QUEUE
> --user admin --password admin --protocol core --message-count 100
> --message-size 1000000 --protocol amqp
> lsof -p <BROKER_PID> | wc -l
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)