artnaseef commented on issue #1731:
URL: https://github.com/apache/activemq/issues/1731#issuecomment-4006473696

   Alternatively, or perhaps together, the `mc.completion.run()` below could be 
moved outside of the critical section as well (this one would require a little 
more work because of the loop):
   
   ```
       public void rollbackPendingCursorAdditions(MessageId messageId) {
           synchronized (indexOrderedCursorUpdates) {
               for (int i = indexOrderedCursorUpdates.size() - 1; i >= 0; i--) {
                   MessageContext mc = indexOrderedCursorUpdates.get(i);
                   if (mc.message.getMessageId().equals(messageId)) {
                       indexOrderedCursorUpdates.remove(mc);
                       if (mc.onCompletion != null) {
                           mc.onCompletion.run();
                       }
                       break;
                   }
               }
           }
       }
   ```
   
   That's 
`org.apache.activemq.broker.region.Queue#rollbackPendingCursorAdditions`


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