Repository navigation
fix(doctor): hold every Git read to one budget #8153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
huangruiteng
merged 3 commits into
loopx-project:main
from
gcl-coder:fix/doctor-git-probe-budget
Nov 6, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 新会话需要在取消时收尾。这里仅捕获 TimeoutExpired;终端 Ctrl-C 向 doctor 所在进程组发 SIGINT 时,communicate 抛 KeyboardInterrupt,独立会话中的 Git/fsmonitor 收不到信号,也没有进入 _retire_owned_probe。真实 doctor+真实 fsmonitor 两次匹配对照:base取消后心跳停止,head在CLI退出后的400ms仍由40增至75字节且两个helper活着。请在中断时回收本次拥有的组并重新抛出原取消,保留超时unknown;增加真实CLI取消和后代停止回归。合成进程已由测试端清理。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修,新 head
28ded5091。取消时由等待的人回收它启动的会话
_run_git现在在communicate上区分两种「没等到答案」:TimeoutExpired:回收本次调用自己的会话,返回None,维持「未知」。KeyboardInterrupt、SystemExit等):同样走_retire_owned_probe回收同一个会话,然后raise原样抛出。独立会话让预算能收回 Git 的后代,代价就是这个会话收不到终端信号——那条路径上唯一的 owner 是正在
communicate的这次调用,所以退出前必须在同一个所有权范围内收尾。超时语义没有变,Ctrl-C仍是Ctrl-C,不是被吞掉的错误。真实 CLI 的取消回归
新增
test_a_cancelled_query_takes_the_helpers_it_started:以start_new_session=True启动真实的 manifest writer CLI(python -m loopx.release_manifest <release_root> --release-id … --source-root <repo>,即安装路径里读来源身份的那个入口),一次性仓库里core.fsmonitor指向真实 hook,hook 带自己的子进程持续写心跳。等心跳确实出现、确认 CLI 仍在等待后,向 CLI 所在进程组 发SIGINT,也就是终端 Ctrl-C 的作用范围。6f7dad1ee断言覆盖三件事:取消后 CLI 以非零退出、没有留下
release.json、以及返回后 0.6 秒内心跳不再增长。每次运行都会写 stop 文件并回收测试自己创建的进程组;用例按os.name != "posix"skip,合成进程不出测试目录。同文件与
tests/test_release_manifest_unanswered_git.py等六个模块合计98 passed;test_doctor_installation_scope.py::…[None]在未改动的origin/main上同样失败,属既有环境问题。