sebthom commented on a change in pull request #2913: ARTEMIS-2571 Remove 
synchronization of ActiveMQServerImpl#getSessions()
URL: https://github.com/apache/activemq-artemis/pull/2913#discussion_r356185619
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
 ##########
 @@ -294,7 +294,7 @@
 
    private FileStoreMonitor fileStoreMonitor;
 
-   private final Map<String, ServerSession> sessions = new 
ConcurrentHashMap<>();
+   private final ConcurrentMap<String, ServerSession> sessions = new 
ConcurrentHashMap<>();
 
 Review comment:
   ATM I am not really sure how I can provide a perf test for the admin UI. The 
issue is that getSessions() can be very 
   
    The getSessions() methods are only used by the ActiveMQServerControlImpl 
and the ConnectionView class, so I would think that this particular change 
cannot negatively affect the hot path.
   
   ATM I am not really sure how I can provide a perf test for the effect in the 
webconsole.
   
   The getSessions() methods are only used by the ActiveMQServerControlImpl and 
the ConnectionView class to list session attributes or to close a session 
manually, so I can't see how removing the synchronized keyword from these 
methods can affect the performance of the hot path negatively.
   
   Also if this synchronization really is required than something else must 
already be broken here since ActiveMQServerImpl.removeSession(), 
ActiveMQServerImpl.createSession() and ActiveMQServerImpl.getSessionByID() 
access/modify the sessions map without synchronizing on `this`.
   
   So even without a perf test I would argue something should be changed, 
either createSession/getSessionByID/removeSession also need to synchronize on 
`this` or the `synchronized` keyword on `getSessions()` methods is useless.
   

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