Skip to content
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

Decouple HTTP/2 pings from idle timeout machinery and make then useful on their own #5607

Open
vkostyukov opened this issue Apr 14, 2024 · 0 comments

Comments

@vkostyukov
Copy link
Contributor

Discussed here in detail: https://discord.com/channels/1087271586832318494/1087272728177942629/1222275984431251559

Today H2 pings work in tandem with the idle timeout to help the client discover bad connections quicker, assuming no other traffic in flight on that connection already. This coupling probably makes pings less useful than they could have been otherwise.

One quick improvement that we make is to provide an optional knob for users to configure their clients to proactively (and less gracefully) tear down connections for which the ACK to ping (the pong?) didn't arrive in time. This decision should be made irregardless to what idle timeout is doing today.

This is how a similar idea is implemented in Finagle (ref).

The rough semantics I'm suggesting for the new functionality are:

  1. Issue pings by a timer, when no reads were performed within a pingTimeout.
  2. If pong doesn't arrive within pingAckTimeout try again for N times (configurable).
  3. If N is exhausted, abort all pending requests and close the connection eagerly (fine to wait for grace period).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants