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

feat(quic): conn scope keepalive #13814

Merged
merged 3 commits into from
Sep 22, 2024

Conversation

qzhuyan
Copy link
Contributor

@qzhuyan qzhuyan commented Sep 16, 2024

Fixes EMQX-13134
Intro a new feature for MQTT over QUIC multi-stream, called connection scope keepalive
We used to require the client to send MQTT.PINGREQ on idle control stream to keep the connection alive even when the data stream is active, this PR intro a conn shared state which has counters could be bumped by all the streams in the same connection, so the keepalive could read this shared counters to judge if conn is still alive.
This hopefully could further mitigate the keepalive timeout due to HOL blocking.

Release version: v/e5.?

Summary

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@qzhuyan qzhuyan requested review from lafirest and a team as code owners September 16, 2024 16:32
@qzhuyan qzhuyan force-pushed the dev/william/quic-conn-scope-keep-alive branch 4 times, most recently from a19b372 to edf88e5 Compare September 19, 2024 11:59
#{keepalive_multiplier := Mul, keepalive_check_interval := CheckInterval} =
emqx_config:get_zone_conf(Zone, [mqtt]),
MilliSeconds = timer:seconds(Second),
Interval = emqx_utils:clamp(CheckInterval, 1000, max(MilliSeconds div 2, 1000)),
MaxIdleMs = ceil(MilliSeconds * Mul),
{StatVal, ReaderFun} =
case is_function(Stat) of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {M, F, A} tuple instead, otherwise badarg during hot-upgrade.

@qzhuyan qzhuyan force-pushed the dev/william/quic-conn-scope-keep-alive branch from 0e5d52d to 857a89e Compare September 20, 2024 23:06
@qzhuyan qzhuyan merged commit 2a209a8 into emqx:master Sep 22, 2024
197 checks passed
@qzhuyan qzhuyan deleted the dev/william/quic-conn-scope-keep-alive branch September 22, 2024 16:25
@emqxqa
Copy link

emqxqa commented Oct 22, 2024

TestExecution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants