Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve PING timeout logic to avoid premature closing of the connection that can occur due to delays in scheduling of writing PING frame to the channel and/or flushing it to the socket.
Motivation and Context
Current PING timeout logic doesnt work well when there are delays in scheduling or flushing to socket.
The change prevents premature closing of the HTTP2 connection. With this change, it will detect dead connections which are otherwise not detected due to inactivity while tolerating scheduling and flushing delays.
Modifications
The callback to send the next ping is scheduled when the ping write is flushed, so it accounts for delays in flushing (because that delay doesnt mean the connection is dead)
Testing
Added 2 new unit tests:
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License