Skip to content

refactor(stream): add asio session coordinator - #803

Draft
qiin2333 wants to merge 3 commits into
masterfrom
agent/asio-session-coordinator
Draft

refactor(stream): add asio session coordinator#803
qiin2333 wants to merge 3 commits into
masterfrom
agent/asio-session-coordinator

Conversation

@qiin2333

@qiin2333 qiin2333 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

依赖

改了啥呀

  • 新增基于 Boost.Asio strand 的活动会话协调器,所有生命周期观测在单写执行域内更新
  • 使用单调状态 starting → active → draining → closed,迟到事件不能让最近关闭的会话复活
  • 固化已认证证书 UUID 所有权;同一会话 ID 尝试切换到其他非空 UUID 时拒绝并计数
  • 保留最多 256 个关闭墓碑,防止迟到回调复活,同时限制内存增长
  • RTSP 的创建、启动成功、客户端取消、自然停止、启动失败和关闭路径发送协调器事件
  • /sessions 增加 lifecycle_state、协调器版本和拒绝事件计数,方便对照现有真实会话状态

迁移边界

这层仍是影子协调器:它不拥有 socket、编码器或音视频线程,也不改变现有 timeout、join()、应用终止和显示恢复时序。事件投递失败会被隔离,不能反向影响串流生命周期。控制面事件经过 strand;编码、采集、加密和媒体发包仍保持原来的并行数据面。

验证

  • git diff --check
  • range-diff 确认旧的 fix(nvhttp): scope cancel to authenticated client #802 lifecycle 修补已归入基线,coordinator 独有逻辑保持不变
  • 使用现有 Windows -Werror 编译参数检查 stream.cppsessions.cpprtsp.cppsession_coordinator.cpp 和协调器测试
  • 完整 Windows 构建与原生测试重新交给本分支 CI

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43fe26a4-83a9-42dc-9624-8952693f6ef9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/asio-session-coordinator

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qiin2333
qiin2333 force-pushed the agent/client-scoped-cancel branch from 8a17d50 to 97431aa Compare July 13, 2026 10:35
@qiin2333
qiin2333 force-pushed the agent/asio-session-coordinator branch from d7e67e8 to fab26ad Compare July 13, 2026 10:38
@qiin2333
qiin2333 force-pushed the agent/client-scoped-cancel branch from 97431aa to 6fbb5ef Compare July 15, 2026 02:52
@qiin2333
qiin2333 force-pushed the agent/asio-session-coordinator branch from fab26ad to 414fcf2 Compare July 15, 2026 02:54
@qiin2333
qiin2333 force-pushed the agent/asio-session-coordinator branch from 414fcf2 to f217d86 Compare July 15, 2026 04:47
Base automatically changed from agent/client-scoped-cancel to master July 15, 2026 06:39
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.

1 participant