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

Cache restart doesn't work properly

    XMLWordPrintable

Details

    Description

      Cache restart has at least two issues:

      1. If a cache is stopped via Cache.stop() it will still be returned by DefaultCacheManager.getCache(). Cache start() and stop() are not synchronized in any way, so a start() call may return before the cache was properly started - just because another thread is in the process of starting it.

      2. ComponentRegistry keeps a few components as fields to speed up access. These components are destroyed on stop() and re-created on start(), because they are volatile, but the field references are not updated.

      Also, the documentation of EmbeddedCacheManager.getCache() should say that it will start the cache only if it doesn't exist yet - if the cache is stopped it will return the cache as it was. Alternatively we could change the behaviour of getCache() to always start the cache.

      Attachments

        Issue Links

          Activity

            People

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: