-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Exception occours if client sends reset frame while the server is sending headers #6906
Comments
so do I, How are you to solve it? |
@ejona86 @nmittler @Scottmitch PTAL... |
It looks like we are sending GO_AWAY in this scenario ... can you confirm this @qwangseu? If so this is a bug. |
The same to me . I occurs when http2-client send RSTFrame(maybe time-out) as @qwangseu say It seems http2-server must maintain stream status (like |
The client sends a request to the server but the server dose not response immediately,so the client sends a reset frame when timeout, if then the server response the request, it will trigger the exception because the stream has been deleted from the streamMap and the netty will try to create a new stream。 |
@qwangseu - yes I understand the sequence of events ... I was just confirming that the issue is there is a GO_AWAY being sent. |
It seems like that the modification can resolve this problem. |
…stream is closed Motivation: DefaultHttp2ConnectionEncoder#writeHeaders attempts to find a stream object, and if one doesn't exist it tries to create one. However in the event that the local endpoint has received a RST_STREAM frame before writing the response headers we attempt to create a stream. Since this stream ID is for the incorrect endpoint we then generate a GO_AWAY for what appears to be a protocol error, but can instead be failed locally. Modifications: - Just fail the local promise in the above situation instead of sending a GO_AWAY Result: Less severe consequences if the server asynchronously sends headers after a RST_STREAM has been received. Fixes netty#6906.
…stream is closed Motivation: DefaultHttp2ConnectionEncoder#writeHeaders attempts to find a stream object, and if one doesn't exist it tries to create one. However in the event that the local endpoint has received a RST_STREAM frame before writing the response headers we attempt to create a stream. Since this stream ID is for the incorrect endpoint we then generate a GO_AWAY for what appears to be a protocol error, but can instead be failed locally. Modifications: - Just fail the local promise in the above situation instead of sending a GO_AWAY Result: Less severe consequences if the server asynchronously sends headers after a RST_STREAM has been received. Fixes netty#6906.
…stream is closed Motivation: DefaultHttp2ConnectionEncoder#writeHeaders attempts to find a stream object, and if one doesn't exist it tries to create one. However in the event that the local endpoint has received a RST_STREAM frame before writing the response headers we attempt to create a stream. Since this stream ID is for the incorrect endpoint we then generate a GO_AWAY for what appears to be a protocol error, but can instead be failed locally. Modifications: - Just fail the local promise in the above situation instead of sending a GO_AWAY Result: Less severe consequences if the server asynchronously sends headers after a RST_STREAM has been received. Fixes netty#6906.
when I use netty http2 to build a server, exception will occour if the client sents a reset frame to the server while the server is sending headers (netty version is 4.1.8.final),
https://github.com/netty/netty/blob/4.1/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionEncoder.java#L156
when the server receives reset frame it will remove the stream from the streamMap, but it will create the stream when it writes headers if it finds the stream is null。
https://github.com/netty/netty/blob/4.1/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java#L687
here the netty will check whether the streamId is even, but the streamId from upstream is always odd.So is there any method to resolve this problem?
The text was updated successfully, but these errors were encountered: