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
Fix a bug where a connection is not closed immediatley when HTTP/2 PING write fails #2699
Conversation
…G write fail Motivation: If a connection is closed unexpectedly by network shutdown, the opposite does not receive close signals such as GOAWAY frame and the connection is alive until cleaning up by request timeout, idle timeout, or PING fail. When PING writes fail, KeepAliveHandler tries to close the connection, which takes for the idle timeout. Because it is configured as `gracefulShutdownTimeoutMillis` for Netty Http2ConnectionHandler. https://github.com/line/armeria/blob/fec9fb833275eba59eb9afaf25fc8b7c28132f80/core/src/main/java/com/linecorp/armeria/server/Http2ServerConnectionHandler.java#L56-L62 Modifications: * Close a connection immediately if KeepAliveHandler is closing. Result: Clean up a dead connection immediately when PING write fails.
Codecov Report
@@ Coverage Diff @@
## master #2699 +/- ##
============================================
- Coverage 72.68% 72.68% -0.01%
- Complexity 11312 11315 +3
============================================
Files 1001 1001
Lines 44297 44302 +5
Branches 5494 5498 +4
============================================
+ Hits 32197 32200 +3
+ Misses 9306 9304 -2
- Partials 2794 2798 +4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Good job, @ikhoon 😄 |
…NG write fails (line#2699) Motivation: If a connection is closed unexpectedly due to a network problem, the remote peer does not receive closing signals such as GOAWAY frame and the connection is alive until cleaned up due to request timeout, idle timeout, or PING failure. When PING write fails, KeepAliveHandler tries to close the connection, which takes as long as the idle timeout. Because the idle timeout is configured as `gracefulShutdownTimeoutMillis` for Netty Http2ConnectionHandler. https://github.com/line/armeria/blob/fec9fb833275eba59eb9afaf25fc8b7c28132f80/core/src/main/java/com/linecorp/armeria/server/Http2ServerConnectionHandler.java#L56-L62 Modifications: * Close a connection immediately if KeepAliveHandler is closing. Result: A dead connection is cleaned up immediately when PING write fails.
Motivation:
If a connection is closed unexpectedly due to a network problem,
the remote peer does not receive closing signals such as GOAWAY frame and
the connection is alive until cleaned up due to request timeout, idle timeout, or PING failure.
When PING write fails, KeepAliveHandler tries to close the connection, which takes as long as the idle timeout.
Because the idle timeout is configured as
gracefulShutdownTimeoutMillis
for Netty Http2ConnectionHandler.armeria/core/src/main/java/com/linecorp/armeria/server/Http2ServerConnectionHandler.java
Lines 56 to 62 in fec9fb8
Modifications:
Result:
A dead connection is cleaned up immediately when PING write fails.