[infinispan-issues] [JBoss JIRA] (ISPN-3141) Conditional commands with Flag.IGNORE_RETURN_VALUES cause NPEs
Adrian Nistor (JIRA)
jira-events at lists.jboss.org
Wed May 29 06:28:55 EDT 2013
[ https://issues.jboss.org/browse/ISPN-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adrian Nistor updated ISPN-3141:
--------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
Integrated in master. Thanks!
> Conditional commands with Flag.IGNORE_RETURN_VALUES cause NPEs
> ---------------------------------------------------------------
>
> Key: ISPN-3141
> URL: https://issues.jboss.org/browse/ISPN-3141
> Project: Infinispan
> Issue Type: Bug
> Components: Core API
> Affects Versions: 5.2.6.Final
> Reporter: Mircea Markus
> Assignee: Mircea Markus
> Labels: 5.2.x
> Fix For: 5.3.0.CR1, 5.3.0.Final
>
>
> The root cause of the exception below is:
> - when Flag.IGNORE_RETURN_VALUES is used the node on which the operation is executed returns NULL
> - the operation being conditional return boolean to the user. The null above is unboxed to a boolean which causes a NPE
> The solution is to ignore the Flag.IGNORE_RETURN_VALUES for conditional operations (remove(k, prevValue) replace(k, prevValue,newValue)) and return the result of the operation: this is a boolean, so the network payload is the same as for null.
> {quote}
> 14:07:57,149 WARN [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (Incoming-2,shared=tcp) ISPN000071: Caught exception when handling command SingleRpcCommand{cacheName='default', command=ReplaceCommand{key=name, oldValue=[B0x42656c61..(4), newValue=[B0x42656c61..(4), metadata=MimeMetadata(text/plain; charset=UTF-8,-1,SECONDS,-1,SECONDS,null,null), flags=null, successful=true, ignorePreviousValue=false}}: java.lang.NullPointerException
> at org.infinispan.CacheImpl.replaceInternal(CacheImpl.java:880)
> at org.infinispan.CacheImpl.replace(CacheImpl.java:871)
> at org.infinispan.DecoratedCache.replace(DecoratedCache.java:551)
> at org.infinispan.xsite.BackupReceiverImpl$BackupCacheUpdater.visitReplaceCommand(BackupReceiverImpl.java:113)
> at org.infinispan.commands.write.ReplaceCommand.acceptVisitor(ReplaceCommand.java:76)
> at org.infinispan.xsite.BackupReceiverImpl.handleRemoteCommand(BackupReceiverImpl.java:76)
> at org.infinispan.xsite.BackupReceiverRepositoryImpl.handleRemoteCommand(BackupReceiverRepositoryImpl.java:87)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommandFromRemoteSite(CommandAwareRpcDispatcher.java:255)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:230)
> at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:460) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:377) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:247) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:665) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.mux.MuxUpHandler.up(MuxUpHandler.java:130) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.JChannel.up(JChannel.java:719) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1008) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.deliver(RELAY2.java:607) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.route(RELAY2.java:507) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.handleMessage(RELAY2.java:482) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.handleRelayMessage(RELAY2.java:463) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.Relayer$Bridge.receive(Relayer.java:302) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.JChannel.up(JChannel.java:749) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1012) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> {quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list