gun icon indicating copy to clipboard operation
gun copied to clipboard

Add keepalive_tolerance http2 option

Open zuiderkwast opened this issue 2 years ago • 1 comments

keepalive_tolerance: The number of unacknowledged pings that can be tolerated before the connection is forcefully closed.

When a keepalive ping is sent to the peer, a counter is incremented and if this counter exceeds the tolerance limit, the connection is forcefully closed. The counter is reset whenever a ping ack is received from the peer.

By default, the mechanism for closing the connection based on ping and ping ack is disabled.

As discussed in #254.

zuiderkwast avatar May 13 '22 14:05 zuiderkwast

Test not yet added.

Please check if you think this feature makes sense. Then I'll add a test case.

zuiderkwast avatar May 13 '22 14:05 zuiderkwast

Please try to avoid these merge commits [Merge remote-tracking branch 'origin/master' into keepalive_tolerance] they make things much harder for me to merge afterwards. git pull --rebase origin master is the way to go (where origin is this repository, on my machine it's named upstream).

essen avatar Oct 24 '22 14:10 essen

OK, I'll revert the merge and do a rebase instead. (Some projects prefer merge instead of force-push since it makes it easier to see what's already reviewed and what's new.)

zuiderkwast avatar Oct 24 '22 14:10 zuiderkwast

No merge commit now. However, I squashed all the commits before rebasing, since otherwise I got multiple intermediate merge conflicts when rebasing.

zuiderkwast avatar Oct 24 '22 15:10 zuiderkwast

No problem, thanks.

essen avatar Oct 24 '22 15:10 essen

I see that most 2.0 tagged PRs have been merged now. Any chance this one can make it to 2.0?

If not, would you prefer adding an idle_timeout instead?

zuiderkwast avatar Nov 22 '22 17:11 zuiderkwast

Merged with many tweaks, even went back on some things I said before. Thanks!

essen avatar Dec 06 '22 15:12 essen

Hey, there's some issues in the tests for this on macOS and Windows. Can you please take a look? If you open a PR it'll run the tests again.

essen avatar Jan 16 '23 19:01 essen

It looks like a timing issue. If something is lagging by 50ms, the gun_down comes too early.

The simplest solution would be to increase the times, making the test take longer to run. Perhaps by a factor 10. Do you have a better idea?

This is from one of the latest mac builds on master:

image

zuiderkwast avatar Jan 16 '23 21:01 zuiderkwast

If it's a timing issue then yes increasing would be fine for the time being. But it's a bit surprising because macOS tends to be the fastest to run tests and have the least amount of issues from it.

essen avatar Jan 16 '23 21:01 essen

OK, here's a boring PR increasing the timeouts 10 times: #309. Let's see if all builds pass.

Are you in control of the mac machines? Maybe they were temporarily heavily loaded or something....

zuiderkwast avatar Jan 16 '23 21:01 zuiderkwast

It's possible for Windows since it's a VM on my (beefy) gaming PC. But macOS is CI-only. I'm in control of all machines so if it's not something trivial I'll be able to take a closer look next week.

essen avatar Jan 16 '23 21:01 essen