netty-reactive-streams icon indicating copy to clipboard operation
netty-reactive-streams copied to clipboard

NPE in HandlerSubscriber in Play 2.5.9

Open wsargent opened this issue 8 years ago • 4 comments

From https://github.com/playframework/playframework/issues/7166

2017-03-19 00:58:35,217 [netty-event-loop-14] ERROR p.c.server.netty.PlayRequestHandler - Exception caught in Netty
java.lang.NullPointerException: null
	at com.typesafe.netty.HandlerSubscriber.maybeRequestMore(HandlerSubscriber.java:271)
	at com.typesafe.netty.HandlerSubscriber.channelWritabilityChanged(HandlerSubscriber.java:130)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:438)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:413)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:438)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:413)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:438)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:413)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelWritabilityChanged(ChannelInboundHandlerAdapter.java:119)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:438)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelWritabilityChanged(AbstractChannelHandlerContext.java:413)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelWritabilityChanged(DefaultChannelPipeline.java:1317)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:438)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelWritabilityChanged(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelWritabilityChanged(DefaultChannelPipeline.java:923)
	at io.netty.channel.ChannelOutboundBuffer$2.run(ChannelOutboundBuffer.java:583)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:408)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
	at java.lang.Thread.run(Thread.java:745)

wsargent avatar Apr 01 '17 03:04 wsargent

I'm seeing this too. I believe it's tied to how HandlerPublisher.receiveCancel() sets subscriber to null without changing state. It feels like something in the cancel chain should set state to NO_SUBSCRIBER (or NO_SUBSCRIBER_OR_CONTEXT)

dgolombek avatar Nov 16 '22 22:11 dgolombek

@dgolombek If you can find out what's going on exactly and provide a fix that would me great :+1:

mkurz avatar Nov 16 '22 22:11 mkurz

Ooops, looks like my stacktrace is slightly different, I'll file a different Issue and submit a patch for that one.

dgolombek avatar Nov 17 '22 02:11 dgolombek