refactor(rtsp): defer client session reaping#804
Draft
qiin2333 wants to merge 1 commit into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
qiin2333
force-pushed
the
agent/asio-session-coordinator
branch
from
July 13, 2026 10:38
d7e67e8 to
fab26ad
Compare
qiin2333
force-pushed
the
codex/defer-client-session-reaping
branch
from
July 13, 2026 10:39
2fc271e to
09fa549
Compare
qiin2333
force-pushed
the
agent/asio-session-coordinator
branch
from
July 15, 2026 02:54
fab26ad to
414fcf2
Compare
qiin2333
force-pushed
the
codex/defer-client-session-reaping
branch
from
July 15, 2026 02:55
09fa549 to
817da99
Compare
Make authenticated client cancel signal matching sessions and wake the RTSP reaper instead of joining worker threads on the HTTPS request path. Coordinate deferred host cleanup with concurrent launch and resume operations, and cover the cleanup gate with focused concurrency tests.
qiin2333
force-pushed
the
agent/asio-session-coordinator
branch
from
July 15, 2026 04:47
414fcf2 to
f217d86
Compare
qiin2333
force-pushed
the
codex/defer-client-session-reaping
branch
from
July 15, 2026 04:47
817da99 to
46dbb84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
依赖
master(已含 feat(stream): expose active session telemetry #801)← fix(nvhttp): scope cancel to authenticated client #802 ← refactor(stream): add asio session coordinator #803 ← 本 PR杂鱼,这次改了什么呀
/cancel只按证书 UUID 标记所属会话为 draining,并立即唤醒 RTSP reaper,不再在 HTTPS 请求线程里同步join()join、应用终止和显示恢复保留在同一个有序清理阶段,避免跨线程同时访问进程与显示生命周期为什么要这样改
之前客户端 cancel 会在 HTTPS 路径里持有 session registry 锁并等待视频、音频和控制线程结束,最坏会触及 10 秒 hang watchdog。多会话压力较高时,这会把协议响应和资源回收绑在一起,客户端就更容易感觉成“退了以后卡住啦”。
这一层仍保持现有所有权和最后会话语义,只拆开“发停止信号”和“完成资源回收”,不把编码、发包或阻塞 join 塞进 Asio strand。
风险和兼容性
/cancel的 200 响应会早于最终线程 join;如果客户端马上 launch/resume,闸门会等待清理完成,因此不会复用正在终止的应用验证
git diff --check-Werror编译参数检查nvhttp.cpp、rtsp.cpp、session_cleanup_gate.cpp和清理闸门测试