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

Robbie Gemmell commented on ARTEMIS-427:
----------------------------------------

The bit you reference shouldnt be an issue, the proton Transport should accept 
partial data at that level. The bit failing here looks to be decoding of 
Message object from the bytes of a Delivery, a process which occurs a bit later 
and is driven by Artemis.

The Message#decode method expects the complete bytes for the message, it wont 
work with partial content. Those bytes are pulled from the Delivery and given 
to the Message class to be decoded, so either the delivery data is itself 
incorrect/incomplete at the AMQP framing level, or Artemis is providing 
incorrect/partial data to the message decode step. ARTEMIS-214 looks to be the 
same issue and looking through the areas mentioned in the stacks shows a 
coincidental use of a 10K buffer in 
org.proton.plug.context.server.ProtonServerReceiverContext.onMessage(Delivery), 
which seems like it could be related somehow.

> 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)

Reply via email to