Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4385

NPE in Configuration Admin Service when deleting configuration

    XMLWordPrintableJSON

Details

    Description

      While writing a test for Apache Felix DependencyManager, I came across the following exception from ConfigAdmin 1.8.0 (under high load):

      ERROR - CM Configuration Updater (Delete: pid=Aspect2.pid23) : Unexpected problem providing configuration Aspect2.pid23 to service [org.osgi.service.cm.ManagedService, id=117, bundle=26/local] - java.lang.NullPointerException
              at java.lang.StringBuffer.<init>(StringBuffer.java:120)
              at org.apache.felix.cm.impl.ConfigurationManager.getTargetedConfiguration(ConfigurationManager.java:523)
              at org.apache.felix.cm.impl.ConfigurationManager$ConfigurationProvider.provideReplacement(ConfigurationManager.java:1666)
              at org.apache.felix.cm.impl.ConfigurationManager$DeleteConfiguration.run(ConfigurationManager.java:1816)
              at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)
              at java.lang.Thread.run(Thread.java:722)
      

      I suspect that this NPE occurs in the following scenario:

      1- one ManagedService listening to a given configuration pid is being unregistered (from one thread)
      2- concurrently, another thread is deleting the Configuration for the same PID the ManagedService was registered for.

      I never wrote some test cases for configuration admin sub-project but I will try to write one in order to reproduce the issue.

      For now, I'm using the attached patch, which seems to fix the problem.

      Attachments

        1. FELIX-4385.patch
          2 kB
          Pierre De Rop
        2. FELIX-4385-integrationtest.tgz
          4 kB
          Pierre De Rop

        Activity

          People

            pderop Pierre De Rop
            pderop Pierre De Rop
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: