Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6831

ConcurrentModificationException in OSGi Installer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Installer Core 3.8.6
    • Fix Version/s: Installer Core 3.8.8
    • Component/s: Installer
    • Labels:
      None

      Description

      Under certain scenarios I'm getting:

      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)
      ...

      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:

          public Collection<String> getEntityIds() {
              return this.data.keySet();
          }

      And the client code iterates over that, causing the exception.

        Attachments

        1. SLING-6831.patch
          1 kB
          David Bosschaert

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              bosschaert David Bosschaert
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: