[ 
https://issues.apache.org/jira/browse/ARTEMIS-5054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17884059#comment-17884059
 ] 

Timothy A. Bish commented on ARTEMIS-5054:
------------------------------------------

I took a look and from what I can gather it seems that on write of the outgoing 
message to the Stomp connection the frame is created and filled using the body 
buffer of a Core message which can happen concurrently for connections from two 
Stomp clients leading to the issue with large messages where the body is stored 
in a file and a LargeBodyReader is used to grant access to those contents, it 
seems that the reader will be shared then between those to threads and when one 
reads while another is reading the state becomes invalid and you can fail in 
odd ways.  

> large messages only forwarded to one subscriber when using STOMP on multicast 
> address
> -------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5054
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5054
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: STOMP
>    Affects Versions: 2.32.0, 2.33.0, 2.34.0, 2.35.0, 2.36.0, 2.37.0
>            Reporter: Renaud Rwemalika
>            Assignee: Justin Bertram
>            Priority: Major
>             Fix For: 2.31.2
>
>
> We noticed a bug that affects versions after 2.31.2. When sending a large 
> message using STOMP (in our use case, we used the stomp.py library from 
> Python) on a MULTICAST address with multiple non-durable queues, we noticed 
> that only one of the queues gets the message forwarded to it.
> Note that the issue does not appear with messages that are not flagged as 
> large messages: all the queues get the message.
> We conducted our test using 20MB messages using the Docker image 
> (docker.io/apache/activemq-artemis:2.37.0) without changing anything in the 
> configuration. 
> Sending a large message with STOMP on a MULTICAST queue generates the 
> following in Artemis logs:  
> {noformat}
> 2024-09-17 12:46:29,850 WARN  
> [org.apache.activemq.artemis.core.protocol.stomp] AMQ332069: Sent ERROR frame 
> to STOMP client 10.0.2.100:34400: null
> 2024-09-17 12:46:29,851 WARN  [org.apache.activemq.artemis.core.server] 
> AMQ222067: Connection failure has been detected: null [code=REMOTE_DISCONNECT]
> 2024-09-17 12:46:29,851 WARN  [org.apache.activemq.artemis.core.server] 
> AMQ222061: Client connection failed, clearing up resources for session 
> dc1a3fc3-74f2-11ef-a9fa-caa03bc75f5c
> 2024-09-17 12:46:29,853 WARN  [org.apache.activemq.artemis.core.server] 
> AMQ222107: Cleared up resources for session 
> dc1a3fc3-74f2-11ef-a9fa-caa03bc75f5c
> 2024-09-17 12:46:29,850 WARN  
> [org.apache.activemq.artemis.core.protocol.stomp] AMQ332071: Unable to send 
> message to client: 
> LargeServerMessage[messageID=34,durable=false,userID=null,priority=4, 
> timestamp=Tue Sep 17 12:46:29 UTC 2024,expiration=0, durable=false, 
> address=simulation.results.inflated-dimensions, 
> properties=TypedProperties[destination=simulation.results.inflated-dimensions,
>  content-length=7057754, _AMQ_LARGE_SIZE=7057754]]@132459861
> java.lang.RuntimeException: 
> ActiveMQIllegalStateException[errorType=ILLEGAL_STATE message=File 34.tmp has 
> a null channel]
>     at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody.getReadOnlyBodyBuffer(LargeBody.java:275)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl.getReadOnlyBodyBuffer(LargeServerMessageImpl.java:257)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.protocol.stomp.VersionedStompFrameHandler.createMessageFrame(VersionedStompFrameHandler.java:334)
>  ~[artemis-stomp-protocol-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.protocol.stomp.StompConnection.createStompMessage(StompConnection.java:630)
>  ~[artemis-stomp-protocol-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.protocol.stomp.StompSession.sendMessage(StompSession.java:169)
>  ~[artemis-stomp-protocol-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl.deliverStandardMessage(ServerConsumerImpl.java:1215)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl.proceedDeliver(ServerConsumerImpl.java:528)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.server.impl.QueueImpl.proceedDeliver(QueueImpl.java:4091)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.server.impl.QueueImpl.deliver(QueueImpl.java:3325)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.server.impl.QueueImpl$DeliverRunner.run(QueueImpl.java:4459)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:57)
>  ~[artemis-commons-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:32)
>  ~[artemis-commons-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:68)
>  ~[artemis-commons-2.37.0.jar:2.37.0]
>     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown 
> Source) [?:?]
>     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
> Source) [?:?]
>     at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.37.0.jar:2.37.0]
> Caused by: 
> org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException: File 
> 34.tmp has a null channel
>     at 
> org.apache.activemq.artemis.core.io.nio.NIOSequentialFile.read(NIOSequentialFile.java:282)
>  ~[artemis-journal-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.io.nio.NIOSequentialFile.read(NIOSequentialFile.java:243)
>  ~[artemis-journal-2.37.0.jar:2.37.0]
>     at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody.getReadOnlyBodyBuffer(LargeBody.java:272)
>  ~[artemis-server-2.37.0.jar:2.37.0]
>     ... 15 more {noformat}
> If you need me to create a project (that would have listeners and producers 
> using the stomp.py library) that can be used to reproduce the error, please 
> let me know.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to