tabish121 commented on code in PR #5848:
URL: https://github.com/apache/activemq-artemis/pull/5848#discussion_r2241136896


##########
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:
   Thinking about it a bit more you might not even need to add volatile since 
the code currently has no consistency constraints in place to ensure 
afterDelivery is called before the close runs and clears the callback it has 
likely been missing that on occasional for ages.  So simply taking a local 
capture and checking for null could be enough to avoid the NPE getting thrown 
and leave things working as they always have. Something to think on



-- 
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


Reply via email to