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

ASF GitHub Bot logged work on ARTEMIS-5890:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Feb/26 23:32
            Start Date: 03/Feb/26 23:32
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #6218:
URL: https://github.com/apache/artemis/pull/6218#discussion_r2761496250


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##########
@@ -173,6 +173,11 @@ private void tryDelivering() {
          logger.trace("AMQP Large Message Writer was closed before queued 
write attempt was executed");
          return;
       }
+      if (protonSender.getSession().getConnection().getRemoteState() != 
EndpointState.ACTIVE || 
protonSender.getSession().getConnection().getLocalState() != 
EndpointState.ACTIVE) {

Review Comment:
   What happens is this:
   
   - there's a pending task in the executor to deliver the large message.
   - before the deliver happens, an onRemoteClose is called: 
   ** 
https://github.com/apache/artemis/blob/db04425978c318abeca026b54e34cdd8afe68c1f/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java#L839-L850
   - The Writer is not closed, when the task reaches the execution point the 
Link will have some invalid state.
   
   
   We need to check the isClosed from the session / connection / link somehow. 
or we need to make the onRemoteClose to also close the Writer.
   





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1003364)
    Time Spent: 0.5h  (was: 20m)

> 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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.51.0
>
>          Time Spent: 0.5h
>  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