-
Notifications
You must be signed in to change notification settings - Fork 669
Support a handler for checking connection status using Ping frame in HTTP/2 #3612
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
base: 1.2.x
Are you sure you want to change the base?
Conversation
171dfc5
to
202d036
Compare
18196bd
to
231b27d
Compare
reactor-netty-http/src/main/java/reactor/netty/http/Http2SettingsSpec.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/Http2SettingsSpec.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/Http2SettingsSpec.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/Http2SettingsSpec.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionLivenessHandler.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionLivenessHandler.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/client/Http2ConnectionLivenessHandler.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConfig.java
Outdated
Show resolved
Hide resolved
...y-http/src/test/java/reactor/netty/resources/PooledConnectionProviderDefaultMetricsTest.java
Show resolved
Hide resolved
reactor-netty-http/src/test/java/reactor/netty/http/client/HttpClientTest.java
Outdated
Show resolved
Hide resolved
@raccoonback Can you rebase against branch |
231b27d
to
a06c842
Compare
@violetagg |
a06c842
to
8c4cdbc
Compare
@raccoonback I'll review this PR later this week |
@raccoonback Nice idea! I think that we can reuse our current I think this feature is interesting for both server and client, similar to TCP keep-alive that we support for both of them. |
@violetagg
Looking forward to your feedback! 😊 |
Yes
Yes
Yes
We may need to move I think that this feature is interesting for both client and server. Wdyt? |
Thank you for the detailed explanation! |
@violetagg |
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
- Added a method to configure the execution interval of the scheduler that sends HTTP/2 PING frames and periodically checks for ACK responses - Introduced a retry threshold setting to limit the number of PING transmission attempts before considering the connection as unresponsive - Default values: - Scheduler interval must be explicitly set - Retry threshold defaults to 0 (no retries, only one PING attempt) Signed-off-by: raccoonback <kosb15@naver.com>
- Added support for HTTP/2 PING-based health checks in IdleTimeoutHandler - Ensures connections remain active during health checks Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
… from pipeline Signed-off-by: raccoonback <kosb15@naver.com>
…sage exchange Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: raccoonback <kosb15@naver.com>
@violetagg |
Signed-off-by: raccoonback <kosb15@naver.com>
Signed-off-by: KOSEUNGBIN <kosb15@naver.com>
Description
In some cases, HTTP/2 connections may remain open even when they are no longer functional. By introducing a periodic Ping frame health check, we can proactively detect and close unhealthy connections.
The Http2ConnectionLivenessHandler schedules and sends Ping frames at a user-defined interval to verify the connection's liveness. If an acknowledgment (ACK) is not received within the specified time, the connection is considered unhealthy and is closed automatically.
However, if other frames are actively being sent or received, the scheduler does not send a Ping frame. This is because the server may delay ACK responses for various reasons. To prevent unnecessary connection termination, Ping frames are only sent when no read or write activity is detected.
Additionally, a configurable retry threshold for Ping frame transmission has been introduced. If a Ping frame fails to receive an ACK response, it will be retried up to the specified threshold before considering the connection unhealthy. This allows fine-tuning of the failure detection mechanism, balancing between aggressive failure detection and avoiding premature disconnections.
Scheduler Flow
Ping ACK Flow
Key Changes
Http2ConnectionLivenessHandler
handler to check connection health with Ping frames at a configurable interval.Http2SettingsSpec
.Related Issue