You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/25 10:00:00 UTC

[jira] [Commented] (ARTEMIS-2095) TypedProperties thread safety

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

ASF GitHub Bot commented on ARTEMIS-2095:
-----------------------------------------

GitHub user michaelandrepearce opened a pull request:

    https://github.com/apache/activemq-artemis/pull/2328

    ARTEMIS-2095 - Typed Properties ThreadSafety

    Add Concurrency Test to expose concurrency errors seen in logs.
    Add Fix to ensure TypedProperties to ensure threadsafety
    Use StampedLock instead of synchronized for better performance where single thread access (or low contention) - similar to its use in ConcurrentLongHashMap.Section

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/michaelandrepearce/activemq-artemis ARTEMIS-2095

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/2328.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2328
    
----
commit f2dcfba4e86c2699964294ba77e59f58d5c49a23
Author: Michael André Pearce <mi...@...>
Date:   2018-09-25T08:50:53Z

    ARTEMIS-2095 - Typed Properties ThreadSafety
    
    Add Concurrency Test to expose concurrency errors seen in logs.
    Add Fix to ensure TypedProperties to ensure threadsafety
    Use StampedLock instead of synchronized for better performance where single thread access (or low contention) - similar to its use in ConcurrentLongHashMap.Section

----


> TypedProperties thread safety
> -----------------------------
>
>                 Key: ARTEMIS-2095
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2095
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Michael Andre Pearce
>            Assignee: Michael Andre Pearce
>            Priority: Major
>
> Whilst TypedProperties is meant to have a single thread acting on it (and this is the most typical interaction), there are occurrences where, it can be acted on by other threads, when this occurs some concurrent modification errors can occur.
> As such TypedProperties must be thread safe, but concurrency tuning should factor in to be most performant for single thread.
>  
> e.g. 
> 2018-09-24 15:01:27,751 WARN [org.apache.activemq.artemis.core.message.impl.CoreMessage] Error creating String for message: : java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) [rt.jar:1.8.0_102] at java.util.HashMap$EntryIterator.next(HashMap.java:1471) [rt.jar:1.8.0_102] at java.util.HashMap$EntryIterator.next(HashMap.java:1469) [rt.jar:1.8.0_102] at org.apache.activemq.artemis.utils.collections.TypedProperties.toString(TypedProperties.java:464)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)