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

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

                Author: ASF GitHub Bot
            Created on: 19/Nov/24 16:02
            Start Date: 19/Nov/24 16:02
    Worklog Time Spent: 10m 
      Work Description: tabish121 commented on code in PR #5346:
URL: https://github.com/apache/activemq-artemis/pull/5346#discussion_r1848637004


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java:
##########
@@ -345,25 +345,23 @@ public void onMessageComplete(Delivery delivery,
                           Message message, DeliveryAnnotations 
deliveryAnnotations) {
       connection.requireInHandler();
 
-      try {
-         receiver.advance();
-
-         Transaction tx = null;
-         if (delivery.getRemoteState() instanceof TransactionalState) {
-            TransactionalState txState = (TransactionalState) 
delivery.getRemoteState();
-            try {
-               tx = this.sessionSPI.getTransaction(txState.getTxnId(), false);
-            } catch (Exception e) {
-               this.onExceptionWhileReading(e);
-            }
-         }
+      receiver.advance();
 
-         actualDelivery(message, delivery, deliveryAnnotations, receiver, tx);
-      } finally {
-         // reader is complete, we give it up now
-         this.messageReader.close();
-         this.messageReader = null;
+      Transaction tx = null;
+      if (delivery.getRemoteState() instanceof TransactionalState) {
+         TransactionalState txState = (TransactionalState) 
delivery.getRemoteState();
+         try {
+            tx = this.sessionSPI.getTransaction(txState.getTxnId(), false);
+         } catch (Exception e) {
+            this.onExceptionWhileReading(e);
+         }
       }
+
+      //  messageReader.close should be called before the delivery, to signal 
the reader is complete.
+      this.messageReader.close();
+      this.messageReader = null;

Review Comment:
   This null assignment should remain in a finally block as it ensures that the 
reader is always nulled when onMessageComplete gets called.





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

    Worklog Id:     (was: 944402)
    Time Spent: 2h 20m  (was: 2h 10m)

> AMQP LargeMessage file can be deleted in error on connection drop if final 
> frame is being processed
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5155
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5155
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.38.0
>            Reporter: Clebert Suconic
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.39.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> This is to fix tests in LargeMessageInterruptTest.
> When sending a large message the file should be closed before calling advance 
> and performing further storage operations.
> This is regressed after 
> c83ed8957d9d7f06bb29c0fce563fe2e3462993e /  ARTEMIS-4668
> Where the file.close was moved to the finalize block after the delivery... 
> causing a possible race over a server's failure.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to