Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1172021

Summary: Cross site state transfer - NPE on consumer site when backup cache is not present
Product: [JBoss] JBoss Data Grid 6 Reporter: Matej Čimbora <mcimbora>
Component: InfinispanAssignee: Pedro Ruivo <pruivo>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Gencur <mgencur>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: jdg-bugs, mhusnain, pruivo, ttarrant
Target Milestone: CR2   
Target Release: 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously in Red Hat JBoss Data Grid, when the backup cache was not defined in the consumer site (with either the same name as the main cache or specified via the &lt;backup-for&gt; option), the customer site would create a new local cache without the RPC manager. This resulted in a NullPointerException being thrown in the consumer site with the following error message also displayed in the producer site: <screen>Unable to pushState to 'XYZ'. org.infinispan.commons.CacheException: Problems invoking command</screen> This issue is now resolved in JBoss Data Grid 6.4 so that if the cache does not exist, it is created with an RPC manager as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-28 13:25:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matej Čimbora 2014-12-09 09:12:35 UTC
Tested on ER7

NPE detected on consumer site after invoking push operation on producer site. Occurs when corresponding cache does not exist on consumer site (either with the same name as the main cache or specified via <backup-for> option).

Configuration:
2 sites, BRN (main), LON (backup)

Producer site CLI:

Unable to pushState to 'LON'. org.infinispan.commons.CacheException: Problems invoking command.

Consumer site log:

[33m11:50:26,235 WARN  [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (remote-thread-0) ISPN000071: Caught exception when handling command XSiteStateTransferControlCommand{control=START_RECEIVE, siteName='BRN', statusOk=false, cacheName='brnCache'}: java.lang.NullPointerException
	at org.infinispan.xsite.BackupReceiverImpl.invokeRemotelyInLocalSite(BackupReceiverImpl.java:212) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.xsite.BackupReceiverImpl.handleStateTransferControl(BackupReceiverImpl.java:89) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.xsite.statetransfer.XSiteStateTransferControlCommand.performInLocalSite(XSiteStateTransferControlCommand.java:41) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$3.run(CommandAwareRpcDispatcher.java:250) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

[33m11:50:26,821 WARN  [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (remote-thread-0) ISPN000071: Caught exception when handling command XSiteStateTransferControlCommand{control=FINISH_RECEIVE, siteName='BRN', statusOk=false, cacheName='brnCache'}: java.lang.NullPointerException
	at org.infinispan.xsite.BackupReceiverImpl.invokeRemotelyInLocalSite(BackupReceiverImpl.java:212) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.xsite.BackupReceiverImpl.handleStateTransferControl(BackupReceiverImpl.java:89) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.xsite.statetransfer.XSiteStateTransferControlCommand.performInLocalSite(XSiteStateTransferControlCommand.java:41) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$3.run(CommandAwareRpcDispatcher.java:250) [infinispan-core-6.2.0-redhat-SNAPSHOT.jar:6.2.0-redhat-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

Comment 2 Martin Gencur 2014-12-09 13:58:28 UTC
Matej, what would you expect in such case when backup cache is not configured and a cache with same name does not exist? A different exception?

Comment 3 Matej Čimbora 2014-12-09 14:15:32 UTC
I'm perfectly fine with warn message being displayed. However I don't think letting NPE be thrown in that case is appropriate. This situation should be handled in the code.

Comment 4 Pedro Ruivo 2014-12-09 15:44:24 UTC
hmm... if the cache does not exists, the backup site will create it. By the line in which the exception is thrown, the cache created is a local cache and it does not have a RpcManager (that's why it is throwing a NPE).

I must check if the cache is local and handle it in the proper way :)

Comment 5 JBoss JIRA Server 2014-12-09 15:45:02 UTC
Pedro Ruivo <pruivo> updated the status of jira ISPN-5061 to Coding In Progress