Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-17252

ConnectionLimitHandler may leaks connection count if remote connection drops

    XMLWordPrintableJSON

Details

    • Degradation - Resource Management
    • Low
    • Normal
    • User Report
    • All
    • None
    • Hide

      Rely on existing client tests.  The exception is hard to reliably provoke - I ended up running many iterations on my laptop with breakpoints set to hit the null while looping connections.

      Show
      Rely on existing client tests.  The exception is hard to reliably provoke - I ended up running many iterations on my laptop with breakpoints set to hit the null while looping connections.

    Description

      In some cases, Netty does not return the original IP used for per-IP counting when the channel becomes inactive,
      which throws an NPE before decrementing the active per-IP count.

      java.lang.NullPointerException
      at org.apache.cassandra.transport.ConnectionLimitHandler.channelInactive(ConnectionLimitHandler.java:101)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
             at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
             at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:389)
             at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:354)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
             at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
             at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
             at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
             at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
             at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819)
             at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
             at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
             at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
             at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
             at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
             at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
             at java.base/java.lang.Thread.run(Thread.java:834)
      

      Attachments

        Activity

          People

            jonmeredith Jon Meredith
            jonmeredith Jon Meredith
            Jon Meredith
            Caleb Rackliffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m