You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "M4n5ter (via GitHub)" <gi...@apache.org> on 2026/09/09 09:36:54 UTC

[PR] fix(runtime-host): fence shutdown admission and cancel pending startup [maka]

M4n5ter opened a new pull request, #5094:
URL: https://github.com/apache/maka/pull/5094

   <details open>
   <summary>English</summary>
   
   ## Summary
   
   Fix three shutdown races: Desktop could hang while a remote Host waited at its compatibility prompt; an idle Host could admit background work after the quit check; Daily Review could start a model after shutdown began while its summary reads were pending.
   
   - Cancel pending initial connections and pairing finalization from the manager's shutdown signal before waiting for queued target operations.
   - Replace the read-only quit probe with the existing Host retirement protocol, which atomically checks activity and stops admission. Busy Hosts require interruption consent; cancelled quit resumes the connection and launch barrier. Quit waits for preparation only, while replacement still waits for process exit through the shared retirement flow. Unreachable Hosts retain the launch-owner-guard fallback.
   - Give Daily Review one lifetime cancellation signal covering preflight reads and model execution, preventing new model calls and archive publication after cancellation.
   
   ## Verification
   
   - **306 tests passed:** 291 Desktop/CLI, Goal admission, scheduling, Daily Review, handoff, retirement and candidate-launch tests; 15 selected Host kernel lifecycle tests.
   - All three regression tests failed against the previous implementation and passed with the fixes. Evidence: pending remote startup now observes an aborted signal; the real Host connection test observes `beginDrain` before quit returns, preserves a cancelled quit, and holds Host cleanup pending without blocking Desktop cleanup; summary-read shutdown produces zero model calls and no archive.
   - Passed full build, lint, format check, typecheck, Desktop/UI Knip, ASF header checks, protocol epoch guard and `git diff --check`. No wire protocol change.
   - Not run: the full repository test suite, manual Electron startup/quit, or a real external model request. Lifecycle tests use controlled production coordinators and a real local Host connection.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex investigated the races, implemented the fixes and tests, and ran verification. The commit includes `Generated-by: OpenAI Codex`.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   
   </details>
   
   <details>
   <summary>简体中文</summary>
   
   ## Summary
   
   修复三个关闭竞态:远程 Host 停在兼容性提示时桌面端可能无法退出;空闲检查后 Host 仍可能接收后台工作;Daily Review 在读取摘要期间收到关闭请求后仍可能启动模型。
   
   - 管理器关闭时先取消初始连接和配对收尾,再等待目标操作结束。
   - 退出复用现有 Host 停止协议,原子完成活动检查和停止准入。有活动时请求中断确认;取消退出会恢复连接及候选进程启动。退出只等待停止准备完成,升级继续通过同一流程等待旧进程退出。无法响应的 Host 保留启动者退出保护作为兜底。
   - Daily Review 使用一个贯穿预读取和模型执行的生命周期取消信号,取消后不再发起模型调用或发布归档。
   
   ## Verification
   
   - **306 项测试通过**:291 项桌面端、CLI、Goal 准入、调度、Daily Review、交接、停止及候选进程测试,加上 15 项 Host 内核生命周期测试。
   - 三个回归测试均在旧实现上失败、修复后通过。证据:远程初始连接收到取消信号;真实 Host 连接测试确认退出返回前已调用 `beginDrain`、取消退出后仍可用,且 Host 清理未完成不会阻塞桌面清理;摘要读取期间关闭后模型调用数为零且无归档。
   - 完整构建、lint、格式检查、类型检查、Desktop/UI Knip、ASF 文件头、协议 epoch 检查和 `git diff --check` 全部通过。未修改线协议。
   - 未运行全仓库测试、手动 Electron 启动/退出或真实外部模型请求;生命周期验证使用受控的生产协调器与真实本地 Host 连接。
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex 完成问题调查、实现、回归测试与验证;提交包含 `Generated-by: OpenAI Codex`。
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime-host): fence shutdown admission and cancel pending startup [maka]

Posted by "M4n5ter (via GitHub)" <gi...@apache.org>.
M4n5ter merged PR #5094:
URL: https://github.com/apache/maka/pull/5094


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org