Skip to content

NullPointerException in AbstractHttp2StreamChannel #9375

@bryce-anderson

Description

@bryce-anderson

Expected behavior

No NPE's

Actual behavior

NPE's

Netty version

4.1.37-Final.

I don't have a clean repro for this, it's showing up in tests that I'm running to upgrade Netty in finagle. A representitive stack trace looks like this:

285 2019-07-16 11:01:39,967 ERR Caught Throwable from listener onStreamClosed.
 286 java.lang.NullPointerException: null
 287         at io.netty.handler.codec.http2.AbstractHttp2StreamChannel$Http2ChannelUnsafe.doBeginRead(AbstractHttp2StreamChannel.java:786)
 288         at io.netty.handler.codec.http2.AbstractHttp2StreamChannel.streamClosed(AbstractHttp2StreamChannel.java:277)
 289         at io.netty.handler.codec.http2.Http2MultiplexCodec.onHttp2StreamStateChanged(Http2MultiplexCodec.java:195)
 290         at io.netty.handler.codec.http2.Http2FrameCodec$ConnectionListener.onStreamClosed(Http2FrameCodec.java:459)
 291         at io.netty.handler.codec.http2.DefaultHttp2Connection.notifyClosed(DefaultHttp2Connection.java:356)
 292         at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.removeFromActiveStreams(DefaultHttp2Connection.java:1000)
 293         at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.deactivate(DefaultHttp2Connection.java:956)
 294         at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultStream.close(DefaultHttp2Connection.java:512)
 295         at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultStream.close(DefaultHttp2Connection.java:518)
 296         at io.netty.handler.codec.http2.Http2ConnectionHandler.closeStream(Http2ConnectionHandler.java:605)

I suspect that we're getting a close call triggered by a doRead and that is causing the inboundBuffer field to be null just in time for the .poll() call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions