Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14901

Check the configuration is present before to add it to config.xml

XMLWordPrintable

      There is probably a very rare concurrent issue in which the configurationManager of OverlayLocalConfigurationStorage does not contain the cache configuration for all caches nor templates defined in the concurrent sets OverlayLocalConfigurationStorage#persistentCaches and OverlayLocalConfigurationStorage#persistentTemplates.

      For this case we want to:
      1. skip to add the related cache / template to the config.xml overlay
      2. log at warn level that this case has happened, so that we can have a proper evidence
       
      This issue has been created analyzing a very rare case raised by an internal customer where the issue was present only with a Windows environment.
       
      Even if the test provided here is not usually able to reproduce the case, I think that this case is possible analyzing the current code base for the following reasons:
       
      1. The method removeTemplateSync is invoke even if the storeTemplates method is not invoked skipping the persistenceLock acquiring phase
      2. The concurrent HashMap key sets persistentCaches and persistentTemplates are traversed where the issue is possibly present with a for each loop than:

      there is no guarantee that one thread will see the changes to the map that the other thread performs (without obtaining a new iterator from the map). The iterator is guaranteed to reflect the state of the map at the time of it's creation. Futher changes may be reflected in the iterator, but they do not have to be.

      As explained here => https://stackoverflow.com/questions/3768554/is-iterating-concurrenthashmap-values-thread-safe.

      IMPORTANT NOTE:

      The log severity of the class

      org.infinispan.globalstate.impl.OverlayLocalConfigurationStorage

      needs to be lowered to DEBUG in order to produce a log for the case we are addressing here.

       

              fercoli@redhat.com Fabio Massimo Ercoli
              fercoli@redhat.com Fabio Massimo Ercoli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: