Skip to content

fix(push): pass stale reaper thread by pointer - #86

Draft
ULookup wants to merge 1 commit into
fix/62-standardize-secret-injectionfrom
fix/82-push-thread-handoff
Draft

fix(push): pass stale reaper thread by pointer#86
ULookup wants to merge 1 commit into
fix/62-standardize-secret-injectionfrom
fix/82-push-thread-handoff

Conversation

@ULookup

@ULookup ULookup commented Jul 22, 2026

Copy link
Copy Markdown
Owner

关联 Issue

Closes #82

目标版本:3.0-dev
堆叠基线:#85fix/62-standardize-secret-injection

变更摘要

仅修正 PushServerBuilder::build() 的 stale-route reaper 线程交接:builder 继续拥有 std::thread,向只借用的 PushServer 传递成员地址,而不是错误地移动线程对象。

根因

PushServer 构造器第八个参数是 std::thread*,调用点却传入 std::thread,因此 Push 服务在 3.0 开发线上无法编译。

RED / GREEN

RED:

cmake --build build-issue-62 --target push_server -j2

稳定失败于 std::thread 无法转换为 std::thread*

GREEN:

cmake -S . -B /tmp/chatnow-issue82-main -DCMAKE_BUILD_TYPE=Debug && cmake --build /tmp/chatnow-issue82-main --target push_server -j2

结果:[100%] Built target push_server

同时通过 git diff --check,最终差异仅 1 个文件、1 行替换。

生命周期与风险

  • builder 在 main 中先于 server 创建,按逆序析构,借用指针在 server 运行与关停期间保持有效。
  • builder 仍是线程唯一 owner;PushServer 仍只负责设置停止标志并 join。
  • 不改变线程算法、路由清理、协议、配置、存储或业务语义。
  • 这是编译期类型交接修复,没有新增运行时行为测试。

CI 边界

本 PR 不修改 .github/workflows/ci.yml。CI 与 clean-slate Compose 的效率/效果改进由 #78 的独立 PR 负责。

已知堆叠关系

PR #84 当前包含相同的一行修复作为其更大 Push 变更的一部分;#82 独立合入后,#84 需要由其所有者 rebase 并丢弃重叠 hunk。本 PR 不改写 #84

审核状态

保持 Draft;等待 #85 与本 PR CI 证据后由人工决定 review-ready,本代理不会合并。

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