#12 AsyncRuntime 锁下状态机:竞争窗口与 coroutine 泄漏封死 - #28
Merged
Conversation
- 状态机 STOPPED/STARTING/RUNNING/STOPPING/FAILED(锁下判定):start 只在上一代完整终止后发布新代;stop 超时 → start 抛 RuntimeError 拒绝 且不创建新线程(验收①) - 每个 awaitable 恰好 await 或 close 一次:superseded 关闭 factory 产物;任何异常路径 finally 兜底 close(验收③,warnings-as-errors 测) - generation 只清理自身:loop/thread/stop_fn/error 均比对 generation 才清(验收④) - 错误根因保留至下次成功 start(FAILED 态不被 stop 覆盖)(验收⑦) - stop 各时相清理:factory 前(stop_event 早退)、factory 内 (superseded close)、返回后(stop_fn+close)、running 后(信号+join) (验收②) - running 保留旧契约(stop_event 置位即 False);20 轮 start/stop 压力零死锁零双活(验收⑤) - ProxyRuntime/SuanpanRuntime 公开接口不变(既有套件全绿,两处 mock 更新到状态机口径)(验收⑥) pytest 1439 全绿。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
评审发现:connection_coordinator._start_proxy 与 app 的 sp.start 均为 裸调用无 try——start() 抛 RuntimeError 会冒上菜单/tick 崩溃。改为 返回 False + error 记录根因(不创建/不替换线程),生产零异常面。 pytest 38 相关绿。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
摘要
验收对照
pytest 1439;Closes #12
🤖 Generated with Claude Code