Add HTTP/2 keep-alive PING policy.#606
Conversation
|
@arturobernalg The change-set will likely need some work, but I am conceptually fine with it. @rschmitt Would you have any conceptual objections to the idea? |
0d9a332 to
a80a98d
Compare
Emit PINGs on otherwise idle connections once SETTINGS are ACKed, and close the session if the peer does not ACK within the configured timeout.
a80a98d to
6224ba5
Compare
This sounds way better than the current HTTP/2 implementation of |
|
I think we have too many config knobs already. I'd really prefer to expose this through |
|
keep-alive is now driven via setValidateAfterInactivity (no new H2Config knob), so it fits the existing connection validation API. |
@ok2c should i do another change here? |
|
@arturobernalg I like the fact that API changes are small, but I find the implementation too complex and overwrought: The process should be quite simple:
|
Initialize keep-alive before first session
@ok2c I reworked the keep-alive handling to follow the exact 4-step process you outlined |
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java
Show resolved
Hide resolved
Issue a single PING before executing pending commands after validateAfterInactivity. Use a short ACK timeout and restore the previous socket timeout on completion. This is a stale-check, not periodic keep-alive.
2e89a80 to
319ad14
Compare
Issue a single pre-flight HTTP/2 PING before executing pending commands when idle > validateAfterInactivity.
Use a short ACK timeout and restore the previous socket timeout on completion.