[jboss-jira] [JBoss JIRA] (AS7-5644) Lost configProperties due to concurrent adds to not thread safe hashmap
RH Bugzilla Integration (JIRA)
issues at jboss.org
Fri Oct 24 09:55:36 EDT 2014
[ https://issues.jboss.org/browse/AS7-5644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
RH Bugzilla Integration updated AS7-5644:
-----------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1156452
> Lost configProperties due to concurrent adds to not thread safe hashmap
> -----------------------------------------------------------------------
>
> Key: AS7-5644
> URL: https://issues.jboss.org/browse/AS7-5644
> Project: Application Server 7
> Issue Type: Bug
> Components: JCA
> Affects Versions: 7.1.3.Final (EAP), EAP 6.1.0.Alpha (7.2.0.Final)
> Reporter: Simone Gotti
> Assignee: Simone Gotti
> Fix For: EAP 6.1.0.Alpha (7.2.0.Final), 7.1.4.Final (EAP)
>
>
> Having a lot of resource adapters configurations, I noticed that sometimes e connection definition/admin object missed one o more config properties (this also led to a further worse problem caused by another bug that I'm also going to report)
> I reproduced it and the problem is caused by the configProperties HashMap in org.jboss.as.connector.subsystems.resourceadapters.Modifiable{AdminObject|ConnDef}.java that is accessed by multiple model operations at the same time.
> I fixed it transforming the HashMap in a ConcurrentHashMap.
> I also noticed that in the past a similar fix was made in ModifiableResourceAdapter where the add* method where made synchronized (probably because the HashMaps are inherited by the classes in IronJacamar).
> Maybe instead of the ConcurrentHashMap a synchronized addConfigProperty (and maybe getConfigProperties) can be used instead.
> My doubt is that I don't known if a ConcurrentHashMap/synchronized methods are enough or also the reads need to be synchronized. From what I see looks like the other method getConfigProperties is called after all the configProperties are added.
> I'm going to attach a pull request with a possible patch that uses a ConcurrentHashMap.
> Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the jboss-jira
mailing list