[ 
https://issues.apache.org/jira/browse/ARTEMIS-2394?focusedWorklogId=278942&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-278942
 ]

ASF GitHub Bot logged work on ARTEMIS-2394:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jul/19 12:23
            Start Date: 18/Jul/19 12:23
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #2727: ARTEMIS-2394 
Improve scheduling sync for AMQPConnectionContext
URL: https://github.com/apache/activemq-artemis/pull/2727#discussion_r304885552
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
 ##########
 @@ -416,42 +414,57 @@ public void onRemoteOpen(Connection connection) throws 
Exception {
        * */
       if (connection.getRemoteProperties() == null || 
!connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) {
          long nextKeepAliveTime = handler.tick(true);
-         synchronized (schedulingLock) {
-            if (nextKeepAliveTime != 0 && scheduledPool != null && 
!isSchedulingCancelled) {
-               scheduledFuture = scheduledPool.schedule(new 
ScheduleRunnable(), (nextKeepAliveTime - 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime())), TimeUnit.MILLISECONDS);
-            }
+
+         if (nextKeepAliveTime != 0 && scheduledPool != null) {
+            scheduleOp.setDelay(nextKeepAliveTime - 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime()));
+
+            scheduledFutureRef.getAndUpdate(scheduleOp);
 
 Review comment:
   there is some specific return value from getOrUpdate that you expect to 
find? if yes, maybe you can put an assert there to help spot issues on tests...
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 278942)
    Time Spent: 4h 20m  (was: 4h 10m)

> Improve scheduling synchronization for AMQPConnectionContext
> ------------------------------------------------------------
>
>                 Key: ARTEMIS-2394
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2394
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Domenico Bruscino
>            Priority: Major
>          Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> Locks in connection stuff, artemis was built on the premise of being 
> nonblocking. As time goes on more and more blocking locks are being added to 
> core code paths.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to