[ 
https://issues.apache.org/jira/browse/ARTEMIS-4923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868119#comment-17868119
 ] 

ASF subversion and git services commented on ARTEMIS-4923:
----------------------------------------------------------

Commit 10adca5479c7d0aa518c0ffce44008e95a268287 in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=10adca5479 ]

ARTEMIS-4923 reduce synchronization in ManagementServiceImpl

The `ManagementService` is used by the broker to register and
unregister components for management as well as send notifications.
When the broker is busy dealing with new sessions and auto-creating
queues, addresses, etc. there is a lot of contention.

To reduce synchronization and improve the service overall this commit
does the following:

 - Remove `synchronized` from most methods. In most cases it's
   completely unnecessary because the methods are already using a
   thread-safe data-structure (e.g. `ConcurrentHashMap`) or more
   specific synchronization is already in place (e.g. on
   `mbeanServer`).
 - Adds new & clarifies existing logging.
 - Synchronizes `start` & `stop` methods and adds gates via `started`.
 - Simplifies the `sendNotification` method by synchronizing once rather
   than twice and performing legitimacy checks sooner.
 - Removing an unnecessary overload of the `registereQueue` method.

To be clear, there are no tests included with this commit as there
should be no semantic changes. Existing tests should be sufficient to
identify any regressions.


> Reduce synchronization in ManagementServiceImpl
> -----------------------------------------------
>
>                 Key: ARTEMIS-4923
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4923
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> The {{ManagementService}} is used by the broker to register and unregister 
> components for management as well as send notifications. When the broker is 
> busy dealing with new sessions and auto-creating queues, addresses, etc. 
> there is a lot of contention in this service. However, much of the 
> synchronization can be removed completely or replaced with more efficient 
> thread-safe underlying data structures.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to