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

Cluster configured CacheManager.removeCache on LOCAL cache results in NPE

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 8.2.4.Final
    • None
    • None
    • Hide

      See attached the JUnit test written for Infinispan 8.2.4 and JGroups 3.6.10. The test creates an embedded JGroups cluster using ports 7800 and 7801.

      The NPE:

      org.infinispan.commons.CacheException: Error removing cache
      	at org.infinispan.manager.DefaultCacheManager.removeCache(DefaultCacheManager.java:533)
      	at RemoveCacheInfinispanCacheTest.testRemoveCache_Local_Fails(RemoveCacheInfinispanCacheTest.java:58)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      Caused by: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from MSPGUSTAFSONR_N-11261, see cause for remote stack trace
      	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
      	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
      	at org.infinispan.manager.DefaultCacheManager.removeCache(DefaultCacheManager.java:530)
      	... 24 more
      Caused by: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from MSPGUSTAFSONR_N-11261, see cause for remote stack trace
      	at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:44)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.checkRsp(JGroupsTransport.java:795)
      	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$invokeRemotelyAsync$1(JGroupsTransport.java:642)
      	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
      	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
      	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
      	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
      	at org.infinispan.remoting.transport.jgroups.RspListFuture.futureDone(RspListFuture.java:31)
      	at org.jgroups.blocks.Request.checkCompletion(Request.java:152)
      	at org.jgroups.blocks.GroupRequest.receiveResponse(GroupRequest.java:116)
      	at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:427)
      	at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357)
      	at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245)
      	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664)
      	at org.jgroups.JChannel.up(JChannel.java:738)
      	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030)
      	at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040)
      	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
      	at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1070)
      	at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:785)
      	at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:426)
      	at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649)
      	at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155)
      	at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:310)
      	at org.jgroups.protocols.FD.up(FD.java:260)
      	at org.jgroups.protocols.MERGE3.up(MERGE3.java:285)
      	at org.jgroups.protocols.Discovery.up(Discovery.java:296)
      	at org.jgroups.protocols.TP.passMessageUp(TP.java:1601)
      	at org.jgroups.protocols.TP$SingleMessageHandler.run(TP.java:1817)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.infinispan.commons.CacheException: java.lang.NullPointerException
      	at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleFromCluster(GlobalInboundInvocationHandler.java:89)
      	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommandFromLocalCluster(CommandAwareRpcDispatcher.java:205)
      	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:175)
      	at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:455)
      	at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:406)
      	at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357)
      	at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245)
      	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664)
      	at org.jgroups.JChannel.up(JChannel.java:738)
      	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030)
      	at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040)
      	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
      	at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:435)
      	at org.jgroups.protocols.pbcast.NAKACK2.deliver(NAKACK2.java:966)
      	at org.jgroups.protocols.pbcast.NAKACK2.handleMessage(NAKACK2.java:848)
      	at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:611)
      	... 10 more
      Caused by: java.lang.NullPointerException
      	at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleCacheRpcCommand(GlobalInboundInvocationHandler.java:126)
      	at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleFromCluster(GlobalInboundInvocationHandler.java:75)
      	... 25 more
      
      Show
      See attached the JUnit test written for Infinispan 8.2.4 and JGroups 3.6.10. The test creates an embedded JGroups cluster using ports 7800 and 7801. The NPE: org.infinispan.commons.CacheException: Error removing cache at org.infinispan.manager.DefaultCacheManager.removeCache(DefaultCacheManager.java:533) at RemoveCacheInfinispanCacheTest.testRemoveCache_Local_Fails(RemoveCacheInfinispanCacheTest.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from MSPGUSTAFSONR_N-11261, see cause for remote stack trace at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) at org.infinispan.manager.DefaultCacheManager.removeCache(DefaultCacheManager.java:530) ... 24 more Caused by: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from MSPGUSTAFSONR_N-11261, see cause for remote stack trace at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:44) at org.infinispan.remoting.transport.jgroups.JGroupsTransport.checkRsp(JGroupsTransport.java:795) at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$invokeRemotelyAsync$1(JGroupsTransport.java:642) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962) at org.infinispan.remoting.transport.jgroups.RspListFuture.futureDone(RspListFuture.java:31) at org.jgroups.blocks.Request.checkCompletion(Request.java:152) at org.jgroups.blocks.GroupRequest.receiveResponse(GroupRequest.java:116) at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:427) at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357) at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245) at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664) at org.jgroups.JChannel.up(JChannel.java:738) at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030) at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040) at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234) at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1070) at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:785) at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:426) at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649) at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155) at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:310) at org.jgroups.protocols.FD.up(FD.java:260) at org.jgroups.protocols.MERGE3.up(MERGE3.java:285) at org.jgroups.protocols.Discovery.up(Discovery.java:296) at org.jgroups.protocols.TP.passMessageUp(TP.java:1601) at org.jgroups.protocols.TP$SingleMessageHandler.run(TP.java:1817) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745) Caused by: org.infinispan.commons.CacheException: java.lang.NullPointerException at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleFromCluster(GlobalInboundInvocationHandler.java:89) at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommandFromLocalCluster(CommandAwareRpcDispatcher.java:205) at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:175) at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:455) at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:406) at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357) at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245) at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664) at org.jgroups.JChannel.up(JChannel.java:738) at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1030) at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040) at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234) at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:435) at org.jgroups.protocols.pbcast.NAKACK2.deliver(NAKACK2.java:966) at org.jgroups.protocols.pbcast.NAKACK2.handleMessage(NAKACK2.java:848) at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:611) ... 10 more Caused by: java.lang.NullPointerException at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleCacheRpcCommand(GlobalInboundInvocationHandler.java:126) at org.infinispan.remoting.inboundhandler.GlobalInboundInvocationHandler.handleFromCluster(GlobalInboundInvocationHandler.java:75) ... 25 more

      While integration testing a common application scoped CacheManager, I hit a problem with LOCAL caches.

      When using a CacheManager which has clustering support configured, attempts to call removeCache() on a LOCAL cache results in a NPE. INVALIDATION_ASYNC caches have no problem though.

      At a minimum I would expect the removal of the cache from the calling CacheManager. It is unclear whether a NON-clustered CacheMode Cache would be removed in all the CacheManagers in the cluster. I would presume not, but I cannot test the behavior to find out. A literal reading of the CacheManager.removeCache(String) method JavaDoc however would expect it to wipe out all LOCAL caches with the same name in the cluster. The JavaDoc could be improved to clarify the behavior for non-clustered CacheModes.

              Unassigned Unassigned
              rgustav_jira Ryan Gustafson (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: