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_r303674832
##########
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:
but rescheduled at, is calculated once before it hits into the getAndUpdate
its doesnt change, either it will be null or not 0, before the atomic, and
there for the logic causing can come outside the function, saving the need for
atomic call altogeather when its 0.
----------------------------------------------------------------
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