clebertsuconic commented on code in PR #5346: URL: https://github.com/apache/activemq-artemis/pull/5346#discussion_r1842959312
########## artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java: ########## @@ -346,6 +346,7 @@ public void onMessageComplete(Delivery delivery, connection.requireInHandler(); try { + this.messageReader.close(); Review Comment: @tabish121 @gemmellr the issue is indeed the close after a failure removing the file. this method here gets closed on a network error, disconnect... etc: https://github.com/apache/activemq-artemis/blob/ffafbf350af6f92f7984cbc251be8f2d5dfcf2d4/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java#L369-L374 If I don't close the reader before the advance I could get to a race where the message was already confirmed and this close could eventually happen. Closing the reader before the advance fixed the issue. I will add a big // COMMENT block explaining the situation here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact