michaelandrepearce commented on a change in pull request #2727: ARTEMIS-2394 
Improve scheduling sync for AMQPConnectionContext
URL: https://github.com/apache/activemq-artemis/pull/2727#discussion_r297872112
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
 ##########
 @@ -436,16 +434,18 @@ public void onRemoteOpen(Connection connection) throws 
Exception {
       public void run() {
          Long rescheduleAt = handler.tick(false);
 
-         synchronized (schedulingLock) {
-            if (!isSchedulingCancelled) {
+         scheduledFutureRef.getAndUpdate(value -> {
+            if (value != null) {
                if (rescheduleAt == null) {
 
 Review comment:
   this can be moved outside the function, as if rescheduleAt == null, then you 
dont need to make a getAndUpdate method call, but just a get, and then the 
function class can be one per parent object, instead of creating one per call.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to