[
https://issues.apache.org/jira/browse/ARTEMIS-4668?focusedWorklogId=908372&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-908372
]
ASF GitHub Bot logged work on ARTEMIS-4668:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 05/Mar/24 17:17
Start Date: 05/Mar/24 17:17
Worklog Time Spent: 10m
Work Description: tabish121 commented on code in PR #4840:
URL: https://github.com/apache/activemq-artemis/pull/4840#discussion_r1513206030
##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##########
@@ -81,33 +84,54 @@ public boolean isWriting() {
public void close() {
if (!closed) {
try {
+ try {
+ if (largeBodyReader != null) {
+ largeBodyReader.close();
+ }
+ } catch (Exception e) {
+ // if we get an error only at this point, there's nothing else
we could do other than log.warn
+ logger.warn("{}", e.getMessage(), e);
+ }
if (message != null) {
message.usageDown();
}
} finally {
- reset(true);
+ resetClosed();
}
}
}
@Override
- public AMQPLargeMessageWriter open() {
- if (!closed) {
- throw new IllegalStateException("Trying to open an AMQP Large Message
writer that was not closed");
+ public AMQPLargeMessageWriter open(MessageReference reference) {
+ this.reference = reference;
+ this.message = (AMQPLargeMessage) reference.getMessage();
Review Comment:
This is storing the message which means a call to close() will call
usageDown on the reference but the way the code is now structured there isn't a
100% certainly that usageUp will always be called on the reference. It needs
to be called here likely so that a close will indeed not accidentally lower
usage when it hadn't been increased.
Issue Time Tracking
-------------------
Worklog Id: (was: 908372)
Time Spent: 4h (was: 3h 50m)
> Move AMQP Large Message File Handling away from Netty thread
> ------------------------------------------------------------
>
> Key: ARTEMIS-4668
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4668
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.32.0
> Reporter: Clebert Suconic
> Assignee: Clebert Suconic
> Priority: Major
> Fix For: 2.33.0
>
> Time Spent: 4h
> Remaining Estimate: 0h
>
> Operations like file.open, file.close, and file.sync should be moved away
> from the Netty Thread for AMQP Large Messages
> This task now is about moving the processing for AMQP Messages. we may in a
> near future also improve tunneled large messages. For now we will do for AMQP
> messages only.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)