brusdev 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_r298009306
##########
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:
In the scenario in which close is executed before or concurrently
onRemoteOpen, the scheduling must be prevented. Checking the current value of
scheduledFutureRef is useful to avoid scheduling after close because it is used
for 2 purpose: keeping the last scheduledFuture and the scheduling status.
----------------------------------------------------------------
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