tabish121 commented on code in PR #5848:
URL: https://github.com/apache/activemq-artemis/pull/5848#discussion_r2240990493
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java:
##########
@@ -526,7 +526,11 @@ public void proceedDeliver(MessageReference reference)
throws Exception {
}
} finally {
pendingDelivery.countDown();
- callback.afterDelivery();
+ synchronized (lock) {
Review Comment:
Given that this can run even when closing it in play as it just blocks the
close cleanup bit from clearing the `callback` until it has been called would
it make more sense to just capture the callback in a local variable under lock
and then execute it outside the synchronized block to avoid staling a task on
the message queue's executor? An in that case it might be less overhead to just
make the `callback` variable volatile and capture it which eliminates the need
to take a lock on each message delivery.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact