[
https://issues.apache.org/jira/browse/ARTEMIS-2210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16728351#comment-16728351
]
ASF GitHub Bot commented on ARTEMIS-2210:
-----------------------------------------
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/2478
@gaohoward The synchronized block will block any threads attempting to both
getting and creating a paging store, while a chm::get is lock-free ie won't
block any threads and chm::computeIfAbsent is locked on per-segment basis (that
means that depends on the number of segments and how the hashing of the keys
will distribute the entries into the segment.
Putting a synchronized like this will prevent any threads to do anything on
an hot-path, blocking each others: my advice is to keep chm::get lock-free (as
it is now) and into `newStore(storeName)` use chm::computeIfAbsent to avoid
duplicates creatings of `PagingStore` instances.
This should keep the scalability as it is now without allocating
unnecessary instances. wdyt?
> PagingStore creation is not properly synchronized
> -------------------------------------------------
>
> Key: ARTEMIS-2210
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2210
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.6.3
> Reporter: Howard Gao
> Assignee: Howard Gao
> Priority: Major
> Fix For: 2.7.0, 2.6.4
>
>
> In PagingManagerImpl#getPageStore() the operations on the map 'stores'
> are not synchronzed and it's possible that more than one paging store is
> created for one address.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)