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

NPE in KeyValueVersionConverter.convert on remove event

    XMLWordPrintable

Details

    Description

      The code for KeyValueVersionConverter#convert currently assumes that the new metadata is always available. This is not true with a remove event since there is no new value or metadata. We should make sure to check null properly. Also we need to verify what should be done if the version is null or not. Currently it sometimes writes the version long which is wrong because deserializing the value will not know if the long is present or not.

      https://github.com/infinispan/infinispan/blob/08cad9bdc46bef3818dd645ea8ea3f5d5b1fb990/server/hotrod/src/main/java/org/infinispan/server/hotrod/KeyValueVersionConverter.java#L39

      19:50:57,311 ERROR (jgroups-75,teraview-lt-2-infinispan-1-16090) [org.infinispan.server.hotrod.BaseRequestProcessor] ISPN005003: Exception reported org.infinispan.commons.CacheException: java.lang.NullPointerException
          at org.infinispan.interceptors.impl.InvocationContextInterceptor.rethrowException(InvocationContextInterceptor.java:135)
          at org.infinispan.interceptors.impl.InvocationContextInterceptor.lambda$new$0(InvocationContextInterceptor.java:61)
          at org.infinispan.interceptors.InvocationExceptionFunction.apply(InvocationExceptionFunction.java:25)
          at org.infinispan.interceptors.impl.QueueAsyncInvocationStage.invokeQueuedHandlers(QueueAsyncInvocationStage.java:124)
          at org.infinispan.interceptors.impl.QueueAsyncInvocationStage.accept(QueueAsyncInvocationStage.java:87)
          at org.infinispan.interceptors.impl.QueueAsyncInvocationStage.accept(QueueAsyncInvocationStage.java:33)
          at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
          at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
          at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
          at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
          at org.infinispan.remoting.transport.AbstractRequest.complete(AbstractRequest.java:67)
          at org.infinispan.remoting.transport.impl.MultiTargetRequest.onResponse(MultiTargetRequest.java:105)
          at org.infinispan.remoting.transport.impl.RequestRepository.addResponse(RequestRepository.java:51)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processResponse(JGroupsTransport.java:1481)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processMessage(JGroupsTransport.java:1383)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport.access$300(JGroupsTransport.java:138)
          at org.infinispan.remoting.transport.jgroups.JGroupsTransport$ChannelCallbacks.up(JGroupsTransport.java:1524)
          at org.jgroups.JChannel.up(JChannel.java:780)
          at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:913)
          at org.jgroups.protocols.FRAG3.up(FRAG3.java:165)
          at org.jgroups.protocols.FlowControl.up(FlowControl.java:347)
          at org.jgroups.protocols.FlowControl.up(FlowControl.java:347)
          at org.jgroups.protocols.pbcast.GMS.up(GMS.java:876)
          at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:254)
          at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1048)
          at org.jgroups.protocols.UNICAST3.addMessage(UNICAST3.java:771)
          at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:752)
          at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:405)
          at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:592)
          at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:132)
          at org.jgroups.protocols.FailureDetection.up(FailureDetection.java:186)
          at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:254)
          at org.jgroups.protocols.MERGE3.up(MERGE3.java:281)
          at org.jgroups.protocols.Discovery.up(Discovery.java:300)
          at org.jgroups.protocols.TP.passMessageUp(TP.java:1400)
          at org.jgroups.util.SubmitToThreadPool$SingleMessageHandler.run(SubmitToThreadPool.java:98)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.lang.NullPointerException
          at org.infinispan.server.hotrod.KeyValueVersionConverter.convert(KeyValueVersionConverter.java:39)  <------------------ converter
          at org.infinispan.server.hotrod.KeyValueVersionConverter.convert(KeyValueVersionConverter.java:17)
          at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.convertValue(CacheNotifierImpl.java:1943)
          at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invokeNoChecks(CacheNotifierImpl.java:1800)
          at org.infinispan.notifications.cachelistener.CacheNotifierImpl$BaseCacheEntryListenerInvocation.invoke(CacheNotifierImpl.java:1784)
          at org.infinispan.notifications.cachelistener.CacheNotifierImpl.doNotifyRemoved(CacheNotifierImpl.java:512)
          at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntryRemoved(CacheNotifierImpl.java:488) 
      

       

      Attachments

        Activity

          People

            wburns@redhat.com Will Burns
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: