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

NullPointerException in HotRodDecoder.channelActive

    XMLWordPrintable

Details

    Description

      HotRodServer.startInternal first starts the Netty transport (with super.startInternal()) and only then initializes the clientListenerRegistry field. That means the server can accept a request before clientListenerRegistry is initialized, causing a NPE in HotRodDecoder.channelActive().

      Visible as random failures in DistTopologyChangeUnderLoadSingleOwnerTest.testRestartServerWhilePutting:

      00:10:54,718 ERROR (HotRodServerWorker-408-1) [CacheDecodeContext] ISPN005009: Unexpected error before any request parameters read java.lang.NullPointerException
          at org.infinispan.server.hotrod.HotRodDecoder.channelActive(HotRodDecoder.scala:284)
          at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:183)
          at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:169)
          at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:817)
          at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:453)
          at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:377)
          at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:423)
          at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
      
      java.util.concurrent.ExecutionException: org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=46498 returned server error (status=0x85): java.lang.NullPointerException
          at java.util.concurrent.FutureTask.report(FutureTask.java:122)
          at java.util.concurrent.FutureTask.get(FutureTask.java:192)
          at org.infinispan.client.hotrod.DistTopologyChangeUnderLoadSingleOwnerTest.testRestartServerWhilePutting(DistTopologyChangeUnderLoadSingleOwnerTest.java:64)
      Caused by: org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=46498 returned server error (status=0x85): java.lang.NullPointerException
          at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:343)
          at org.infinispan.client.hotrod.impl.protocol.Codec20.readPartialHeader(Codec20.java:132)
          at org.infinispan.client.hotrod.impl.protocol.Codec20.readHeader(Codec20.java:118)
          at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:56)
          at org.infinispan.client.hotrod.impl.operations.AbstractKeyValueOperation.sendPutOperation(AbstractKeyValueOperation.java:56)
          at org.infinispan.client.hotrod.impl.operations.PutOperation.executeOperation(PutOperation.java:32)
          at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:54)
          at org.infinispan.client.hotrod.impl.RemoteCacheImpl.put(RemoteCacheImpl.java:268)
          at org.infinispan.client.hotrod.impl.RemoteCacheSupport.put(RemoteCacheSupport.java:79)
          at org.infinispan.client.hotrod.DistTopologyChangeUnderLoadSingleOwnerTest$PutHammer.call(DistTopologyChangeUnderLoadSingleOwnerTest.java:76)
          at org.infinispan.client.hotrod.DistTopologyChangeUnderLoadSingleOwnerTest$PutHammer.call(DistTopologyChangeUnderLoadSingleOwnerTest.java:67)
          at org.infinispan.test.AbstractInfinispanTest$LoggingCallable.call(AbstractInfinispanTest.java:478)
          ... 4 more
      

      Attachments

        Activity

          People

            dberinde@redhat.com Dan Berindei
            dberinde@redhat.com Dan Berindei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: