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

Clebert Suconic commented on ARTEMIS-5890:
------------------------------------------

I hacked qpid locally to show where the change happened, as I was chasing what 
changed the property:


{code:java}
java.lang.Exception: changed here
        at 
org.apache.qpid.proton.engine.impl.LinkImpl.advance(LinkImpl.java:179)
        at 
org.apache.qpid.proton.engine.impl.SenderImpl.advance(SenderImpl.java:127)
        at 
org.apache.qpid.proton.engine.impl.DeliveryImpl.settle(DeliveryImpl.java:162)
        at 
org.apache.qpid.proton.engine.impl.DeliveryImpl.free(DeliveryImpl.java:196)
        at org.apache.qpid.proton.engine.impl.LinkImpl.doFree(LinkImpl.java:140)
        at 
org.apache.qpid.proton.engine.impl.SenderImpl.doFree(SenderImpl.java:116)
        at 
org.apache.qpid.proton.engine.impl.EndpointImpl.free(EndpointImpl.java:190)
        at 
org.apache.qpid.proton.engine.impl.SessionImpl.doFree(SessionImpl.java:149)
        at 
org.apache.qpid.proton.engine.impl.EndpointImpl.free(EndpointImpl.java:190)
        at 
org.apache.qpid.proton.engine.impl.ConnectionImpl.doFree(ConnectionImpl.java:210)
        at 
org.apache.qpid.proton.engine.impl.EndpointImpl.free(EndpointImpl.java:190)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.onRemoteClose(AMQPConnectionContext.java:841)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.handler.Events.dispatch(Events.java:38)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.dispatch(ProtonHandler.java:588)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.handleFlush(ProtonHandler.java:390)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.flush(ProtonHandler.java:375)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler.inputBuffer(ProtonHandler.java:333)
        at 
org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext.inputBuffer(AMQPConnectionContext.java:309)
        at 
org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:180)
        at 
org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:907)
        at 
org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at 
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
        at 
io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:805)
        at 
io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at 
org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:120)
{code}

By the time the close came from the client, the server had already issued a 
runnable to deliver the large message. the large message deliverer (writer) is 
not checking for this state again.
the Writer happens on the Netty handler, so it would be thread safe to check 
for the status of the connection and interrupt the writer execution, and I 
proposed that fix.

> Closing a connection while large message is being delivered could show 
> exceptions in the log
> --------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5890
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5890
>             Project: Artemis
>          Issue Type: Bug
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.52.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> If you close a connection while the server still delivering large messages, 
> you could see exceptions in the logs (IllegalArgumentException).
> The delivery thread should check the state of the connection before issuing 
> more deliveries.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to