diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java index 5243ed84d6..8e30d40fc0 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java @@ -820,12 +820,6 @@ public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http future.addListener((ChannelFutureListener) future1 -> processGoAwayWriteResult(ctx, lastStreamId, errorCode, debugData, future1)); } - // if closeListener != null this means we have already initiated graceful closure. doGracefulShutdown will apply - // the gracefulShutdownTimeoutMillis on each invocation, however we only care to apply the timeout on the - // start of graceful shutdown. - if (errorCode == NO_ERROR.code() && closeListener == null) { - doGracefulShutdown(ctx, future, null); - } return future; } diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameCodecTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameCodecTest.java index 7b3ef43442..dd8f822554 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameCodecTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2FrameCodecTest.java @@ -330,8 +330,8 @@ public class Http2FrameCodecTest { channel.writeOutbound(goAwayFrame); verify(frameWriter).writeGoAway(eqFrameCodecCtx(), eq(7), eq(NO_ERROR.code()), eq(expected), anyChannelPromise()); - assertEquals(State.CLOSED, stream.state()); - assertFalse(channel.isActive()); + assertEquals(State.OPEN, stream.state()); + assertTrue(channel.isActive()); expected.release(); debugData.release(); } @@ -395,8 +395,8 @@ public class Http2FrameCodecTest { verify(frameWriter).writeGoAway(eqFrameCodecCtx(), eq(Integer.MAX_VALUE), eq(NO_ERROR.code()), eq(debugData), anyChannelPromise()); debugData.release(); - assertEquals(State.CLOSED, stream.state()); - assertFalse(channel.isActive()); + assertEquals(State.OPEN, stream.state()); + assertTrue(channel.isActive()); } @Test