Uploaded image for project: 'Pax JDBC'
  1. PAXJDBC-138

DataSourceConfigManager should use a ConcurrentHashMap instead of HashMap

    Details

    • Type: Dependency upgrade
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5
    • Labels:
      None
    • Sprint:

      Description

      If two DataSources are created exactly at same time (race condition), we have a concurrent modification:

      org.osgi.framework.BundleException: Activator stop error in bundle org.ops4j.pax.jdbc.config [33].
              at org.apache.felix.framework.Felix.stopBundle(Felix.java:2692)
              at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1038)
              at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.stopBundle(BundleInstallSupportImpl.java:167)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.stopBundle(FeaturesServiceImpl.java:1121)
              at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:748)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.util.ConcurrentModificationException
              at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
              at java.util.HashMap$KeyIterator.next(HashMap.java:1466)
              at org.ops4j.pax.jdbc.config.impl.DataSourceConfigManager.destroy(DataSourceConfigManager.java:193)
              at org.ops4j.pax.jdbc.config.impl.Activator.stop(Activator.java:77)
              at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:719)
              at org.apache.felix.framework.Felix.stopBundle(Felix.java:2636)
              ... 10 more
      

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofre
              Reporter:
              jbonofre Jean-Baptiste Onofre
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: