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

NPE during state transfer after restarting cache

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.2.0.ALPHA3
    • 4.2.0.ALPHA2
    • State Transfer
    • None

    Description

      When a named cache is restarted, and fetchInMemoryState = true, the state transfer initiated in StateTransferManager.start() causes a NPE, because the cache's ComponentRegistry does not get reregistered with the GlobalComponentRegistry.

      The NPE comes from InboundInvocationHandlerImpl:

      public void applyState(String cacheName, InputStream i) throws StateTransferException

      { getStateTransferManager(cacheName).applyState(i); }

      private StateTransferManager getStateTransferManager(String cacheName) throws StateTransferException {
      ComponentRegistry cr = gcr.getNamedComponentRegistry(cacheName);
      if (cr == null)

      { return null; }

      return cr.getComponent(StateTransferManager.class);
      }

      A quick glance at ComponentRegistry indicates that the registry is registered with the GlobalComponentRegistry in the constructor and unregistered in stop(). Because of the unbalanced logic, when the stopped component registry is restarted, it never gets re-registered with the GlobalComponentRegistry, hence the NPE during state transfer the second time around.

      This specific regression was introduced in revision 2384. Rolling back ComponentRegistry.java to revision 2273 resolves the issue.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            pferraro@redhat.com Paul Ferraro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: