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

Justin Bertram edited comment on ARTEMIS-4217 at 3/28/23 8:11 PM:
------------------------------------------------------------------

Given that the trace logs don't have any information from when the issue 
actually occurred I'm going to remove them so as to not waste infrastructure 
resources.

I still don't understand why there is even a need to convert the message from 
core to AMQP given that there are no core clients involved on this queue. As 
far as I can tell the message should be in AMQP format throughout its life on 
the broker with no conversion necessary.

I took a look at the code throwing the exception and it invokes {{openFile()}} 
immediately before checking the size of the file so it _should_ be open unless 
another thread is causing the file to get closed somehow although at this point 
I don't see how that's possible. I could potentially provide you with a jar 
that has additional logging that might help us get to the bottom of this. 
Unfortunately I don't have an environment where I can run C# code to attempt to 
reproduce this myself.


was (Author: jbertram):
Given that the trace logs don't have any information from when the issue 
actually occurred I'm going to remove them so as to not waste infrastructure 
resources.

I still don't understand why there is even a need to convert the message from 
core to AMQP given that there are no core clients involved on this queue. As 
far as I can tell the message should be in AMQP format throughout its life on 
the broker with no conversion necessary.

I took a look at the code throwing the exception and it invokes {{openFile()}} 
immediately before checking the size of the file so it _should_ be open unless 
another thread is causing the file to get closed somehow although at this point 
I don't see how that's possible. I could potentially provide you with a jar 
that has additional logging that might help us get to the bottom of this. 
Unfortunately I don't have an environment where I can run C# code so attempt to 
reproduce this myself.

> AMQ111005: Failed to convert message. Sending it to Dead Letter Address.
> ------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4217
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4217
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>    Affects Versions: 2.28.0
>         Environment: Windows Server 2022 21H2
> openjdk 19.0.1 2022-10-18
> OpenJDK Runtime Environment (build 19.0.1+10-21)
> OpenJDK 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
>            Reporter: daves
>            Priority: Major
>         Attachments: ArtemisConvertError.zip
>
>
> Some of the AMQP messages sent by my client never arrive at the consumer. In 
> the Artemis log I found the following exception:
> {noformat}
> 2023-03-23 18:06:58,084 WARN  
> [org.apache.activemq.artemis.protocol.amqp.logger] AMQ111005: Failed to 
> convert message. Sending it to Dead Letter Address. 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.ConversionException:
>  java.nio.channels.ClosedChannelException
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.CoreAmqpConverter.fromCore(CoreAmqpConverter.java:318)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.CoreAmqpConverter.checkAMQP(CoreAmqpConverter.java:79)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext.executeDelivery(ProtonServerSenderContext.java:561)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl.run(MessageReferenceImpl.java:131)
>  ~[artemis-server-2.28.0.jar:2.28.0]     
>      at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
>  ~[netty-common-4.1.86.Final.jar:4.1.86.Final]     
>      at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
>  ~[netty-common-4.1.86.Final.jar:4.1.86.Final]     
>      at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  ~[netty-common-4.1.86.Final.jar:4.1.86.Final]     
>      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) 
> ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]     
>      at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  ~[netty-common-4.1.86.Final.jar:4.1.86.Final]     
>      at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> ~[netty-common-4.1.86.Final.jar:4.1.86.Final]     
>      at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  ~[artemis-commons-2.28.0.jar:?] Caused by: java.lang.RuntimeException: 
> java.nio.channels.ClosedChannelException     
>      at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody.getBodyBufferSize(LargeBody.java:293)
>  ~[artemis-server-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl.getBodyBufferSize(LargeServerMessageImpl.java:263)
>  ~[artemis-server-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.getBodyLength(CoreBytesMessageWrapper.java:98)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.getBinaryFromMessageBody(CoreBytesMessageWrapper.java:68)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.createAMQPSection(CoreBytesMessageWrapper.java:78)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.CoreAmqpConverter.fromCore(CoreAmqpConverter.java:106)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      ... 10 more 
> Caused by: java.nio.channels.ClosedChannelException     
>      at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:165) 
> ~[?:?]     
>      at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:416) ~[?:?]     
>      at 
> org.apache.activemq.artemis.core.io.nio.NIOSequentialFile.size(NIOSequentialFile.java:339)
>  ~[artemis-journal-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody.getBodyBufferSize(LargeBody.java:285)
>  ~[artemis-server-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl.getBodyBufferSize(LargeServerMessageImpl.java:263)
>  ~[artemis-server-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.getBodyLength(CoreBytesMessageWrapper.java:98)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.getBinaryFromMessageBody(CoreBytesMessageWrapper.java:68)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.coreWrapper.CoreBytesMessageWrapper.createAMQPSection(CoreBytesMessageWrapper.java:78)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]     
>      at 
> org.apache.activemq.artemis.protocol.amqp.converter.CoreAmqpConverter.fromCore(CoreAmqpConverter.java:106)
>  ~[artemis-amqp-protocol-2.28.0.jar:2.28.0]
>      ... 10 more{noformat}
> I tried to reproduce the error with trace log level enabled, but the problem 
> never occurs with trace enabled (same message payload).  Maybe it is a timing 
> issue which not occurs when Artemis processes messages much slower due to 
> additional tracing...?



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

Reply via email to