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

GlobalConfiguration should keep strong reference to classloader

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.4.0.CR3
    • Fix Version/s: 9.4.0.Final
    • Component/s: Core
    • Labels:
      None

      Description

      GlobalConfiguration uses a WeakReference to store its classloader, in order to allow JCachingProvider to use a WeakHashMap<ClassLoader, DefaultCacheManager>.

      The weak reference works fine when the classloader is the application classloader, but if the application (or the server, in our case) creates a ClassLoader instance just for the Infinispan configuration, that classloader can be garbage collected while the cache manager is starting. That is exactly what happens during server startup sometimes, making GlobalComponentRegistry use the TCCL for module initialization and ignoring all the non-core modules.

      We can still use a WeakClassLoader adapter that wraps a WeakReference<ClassLoader> for JCachingProvider.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dan.berindei Dan Berindei
                  Reporter:
                  dan.berindei Dan Berindei
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: