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

Carsten Ziegeler commented on SLING-6831:
-----------------------------------------

I've now added the missing sync in two places, I hope that will fix the problem 
(rev 1793992)
The only client of PersistentResourceList is OSGiInstallerImpl - so we can add 
locking in the relevant places and have full control.
Now, the whole installer core code has grown over time and is not really that 
maintainable anymore. Therefore I don't want to add new behaviour in the 
internal classes

> ConcurrentModificationException in OSGi Installer
> -------------------------------------------------
>
>                 Key: SLING-6831
>                 URL: https://issues.apache.org/jira/browse/SLING-6831
>             Project: Sling
>          Issue Type: Bug
>          Components: Installer
>    Affects Versions: Installer Core 3.8.6
>            Reporter: David Bosschaert
>            Assignee: Carsten Ziegeler
>             Fix For: Installer Core 3.8.8
>
>         Attachments: SLING-6831.patch
>
>
> Under certain scenarios I'm getting: 
> {code}java.util.ConcurrentModificationException: null
>       at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
>       at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
>       at 
> org.apache.sling.installer.core.impl.OsgiInstallerImpl.getInstallationState(OsgiInstallerImpl.java:1390)
> ...{code}
> To me this seems caused by the fact that the Map datastructure in the 
> PersistentResourceList is non-concurrent.
> PersistentResourceList.getEntityIds() returns the map's values directly. This 
> is what is used in OsgiInstallerImpl line 1390:
> {code}
>     public Collection<String> getEntityIds() {
>         return this.data.keySet();
>     }{code}
> And the client code iterates over that, causing the exception.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to