Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received DATA frame for an unknown stream error #4651

Closed
nkrode opened this issue Jul 18, 2018 · 5 comments
Closed

Received DATA frame for an unknown stream error #4651

nkrode opened this issue Jul 18, 2018 · 5 comments

Comments

@nkrode
Copy link

nkrode commented Jul 18, 2018

Grpc Version: 1.13.1

Hi - We are seeing few sporadic "Received DATA frame for an unknown stream" error on server side. On the client side we are making a unary call with deadline. Is this error expected on server side when the client deadline has been exceeded?

On the server side we do check if the context hasn't been cancelled via something like:

final Context requestContext = Context.current();
        if (requestContext.isCancelled()) {
            responseObserver.onError(Status.CANCELLED.withDescription("Cancelled by client").asRuntimeException());
            return;
        }

Here's the stack trace:

Jul 17, 2018 6:19:16 PM io.grpc.netty.NettyServerHandler onStreamError
WARNING: Stream Error
io.netty.handler.codec.http2.Http2Exception$StreamException: Received DATA frame for an unknown stream 2001
	at io.netty.handler.codec.http2.Http2Exception.streamError(Http2Exception.java:129)
	at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder$FrameReadListener.shouldIgnoreHeadersOrDataFrame(DefaultHttp2ConnectionDecoder.java:535)
	at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder$FrameReadListener.onDataRead(DefaultHttp2ConnectionDecoder.java:187)
	at io.netty.handler.codec.http2.Http2InboundFrameLogger$1.onDataRead(Http2InboundFrameLogger.java:48)
	at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readDataFrame(DefaultHttp2FrameReader.java:421)
	at io.netty.handler.codec.http2.DefaultHttp2FrameReader.processPayloadState(DefaultHttp2FrameReader.java:251)
	at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readFrame(DefaultHttp2FrameReader.java:160)
	at io.netty.handler.codec.http2.Http2InboundFrameLogger.readFrame(Http2InboundFrameLogger.java:41)
	at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder.decodeFrame(DefaultHttp2ConnectionDecoder.java:118)
	at io.netty.handler.codec.http2.Http2ConnectionHandler$FrameDecoder.decode(Http2ConnectionHandler.java:390)
	at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:450)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:808)
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:408)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:297)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
@zhangkun83
Copy link
Contributor

Cancellation or deadline-exceeded should not cause this error.
Does the stream ID always read "2001" or does it vary?
Do you see the RPC being cancelled when the deadline is exceeded on the client side?

@nkrode
Copy link
Author

nkrode commented Jul 20, 2018

The stream id varies, is not always "2001". I do have multiple apps/client connected to the host though.

Yeah I do see deadline exceeded on the client side but don't think it is always, so might not be necessarily related to the deadline issue.

@zhangkun83
Copy link
Contributor

/cc @ejona86 , @carl-mastrangelo

@ejona86
Copy link
Member

ejona86 commented Jul 20, 2018

Yes, this can happen when cancellation is triggered. When the cancellation is triggered (due to the deadline) the server forgets about the stream and if there was data still in-transit, when it arrives the server won't remember the stream. (Note that the client will also be cancelling, so this message isn't guaranteed to happen; it's racy.)

I think this is a dupe of #3548. That said, a fix for this problem is being worked on in netty/netty#8028

@ejona86
Copy link
Member

ejona86 commented Jul 24, 2018

Closing as duplicate of #3548.

@ejona86 ejona86 closed this as completed Jul 24, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants