[
https://issues.apache.org/jira/browse/ARTEMIS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15192844#comment-15192844
]
Ari Tilli commented on ARTEMIS-427:
-----------------------------------
Thanks a lot, ( I really mean it so BIG BIG thank you , I have to push my
internal 1.3 version to "production" today.)
I just naively patched 256k buffer size to ->
org.proton.plug.context.server.ProtonServerReceiverContext.onMessage(Delivery)
and it now looks ok for my messages sizes. (Messages are xml so application
layer tries to keep them small so they fit to cpu caches).
In general Aretmis/HornetQ is full buffer copies, which sound off for high
performance MoM, IMO application layer data should be kept
in linked lists and not to copy buffers from protocol to another. Of course it
might be difficult when connecting different libraries, or
calculating crcs, hashes etc.
Let's see if I have later time to provide a proper patch.
(Code base in question is quite large with netty, proton etc so understanding
the right way to patch the real problem is not so easy after looking code for
15 minutes,
so we probably need real Artemis developer here.)
> Large messages cause underflow in proton.
> -----------------------------------------
>
> Key: ARTEMIS-427
> URL: https://issues.apache.org/jira/browse/ARTEMIS-427
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: AMQP
> Affects Versions: 1.3.0
> Environment: RHEL7.2 + openJDK
> Reporter: Ari Tilli
>
> Moved away from STOMP to AMQP since sending 100k messages caused connection
> to break.
> Now when server side is updated to use qpid-c++ messages are still not
> routed to clients (Clients still use STOMP.)
> When sending messages of for example 77746 bytes, message is
> not received by client, and reason is that some buffer "underflows".
> After reading some messages from qpid proton list (they send big
> messages) , this seems to be Artemis issue.
> java.nio.BufferUnderflowException
> at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:151)
> at
> org.apache.qpid.proton.codec.DecoderImpl.readRaw(DecoderImpl.java:939)
> at
> org.apache.qpid.proton.codec.BinaryType$LongBinaryEncoding.readValue(BinaryType.java:110)
> at
> org.apache.qpid.proton.codec.BinaryType$LongBinaryEncoding.readValue(BinaryType.java:67)
> at
> org.apache.qpid.proton.codec.DynamicTypeConstructor.readValue(DynamicTypeConstructor.java:39)
> at
> org.apache.qpid.proton.codec.DecoderImpl.readObject(DecoderImpl.java:887)
> at
> org.apache.qpid.proton.message.impl.MessageImpl.decode(MessageImpl.java:658)
> at
> org.apache.qpid.proton.message.impl.MessageImpl.decode(MessageImpl.java:574)
> at
> org.apache.qpid.proton.jms.EncodedMessage.decode(EncodedMessage.java:46)
> at
> org.apache.qpid.proton.jms.JMSMappingInboundTransformer.transform(JMSMappingInboundTransformer.java:40)
> at
> org.apache.activemq.artemis.core.protocol.proton.converter.ProtonMessageConverter.inboundJMSType(ProtonMessageConverter.java:57)
> at
> org.apache.activemq.artemis.core.protocol.proton.converter.ProtonMessageConverter.inbound(ProtonMessageConverter.java:43)
> at
> org.apache.activemq.artemis.core.protocol.proton.plug.ProtonSessionIntegrationCallback.serverSend(ProtonSessionIntegrationCallback.java:264)
> at
> org.proton.plug.context.server.ProtonServerReceiverContext.onMessage(ProtonServerReceiverContext.java:116)
> at
> org.proton.plug.context.AbstractConnectionContext$LocalListener.onDelivery(AbstractConnectionContext.java:273)
> at org.proton.plug.handler.Events.dispatch(Events.java:100)
> at
> org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:363)
> at
> org.proton.plug.handler.impl.ProtonHandlerImpl.flush(ProtonHandlerImpl.java:283)
> at
> org.proton.plug.handler.impl.ProtonHandlerImpl.inputBuffer(ProtonHandlerImpl.java:183)
> at
> org.proton.plug.context.AbstractConnectionContext.inputBuffer(AbstractConnectionContext.java:89)
> at
> org.apache.activemq.artemis.core.protocol.proton.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:128)
> at
> org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:627)
> at
> org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68)
> at
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
> at
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
> at
> io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
> at
> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
> at
> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
> at
> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
> at
> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
> at
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
> at java.lang.Thread.run(Thread.java:745)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)