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

Configuration Admin updates with empty properties and throws NullPointerExceptions due to race condition

    XMLWordPrintableJSON

Details

    Description

      There appears to be a race condition in the configuration admin that allows managed services to get updated with empty properties (but not null). Furthermore, due to the same bug NullPointerExceptions appear under heavy load.

      Fortunately, I think I was able to isolate the bug. The issue is that configurations are persisted when created but before they are initialized (i.e., given a configuration). If during this window a new ManagedService appears it gets updated with an empty Dictionary. Likewise, if the configuration is re-read after such an update attempt it does not have a pid which causes the null pointer exceptions.

      The fix seems to be rather simple (unless I'm missing something but took me some time to figure out.

      Attachments

        1. empty-properties.patch
          0.7 kB
          Karl Pauls
        2. ConfigAdmin.FELIX-335.patch
          15 kB
          Felix Meschberger
        3. ConfigAdmin.FELIX-335_2.patch
          27 kB
          Felix Meschberger

        Activity

          People

            fmeschbe Felix Meschberger
            karlpauls Karl Pauls
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: