[operation-graph] WatchLoop.runIPCAsync never exits when the IPC host disconnects, so heft run-watch outlives its host
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- devtools
调研方向
在 @rushstack/operation-graph 包中找到 WatchLoop.runIPCAsync,并阅读现有的 IPC 消息处理逻辑。通过断开主机连接或终止主机来重现报告的情况,然后检查 watch-loop 测试是否覆盖了该情况。完成标准是:IPC 通道关闭后循环结束且 Heft 退出,同时不影响现有 exit 命令的行为。
由索引模型根据 Issue 内容生成。
描述
🤖 Filed by GitHub Copilot acting for @namankanakiya (light review only).
Package: @rushstack/operation-graph 0.7.4 (via @rushstack/heft 1.3.2). Linux, Node 22.
Repro: in any Heft project, create host.js:
const cp = require('child_process').fork(
require.resolve('@rushstack/heft/bin/heft'),
['run-watch', '--only', 'build'],
{ stdio: ['inherit', 'inherit', 'inherit', 'ipc'] }
);
setTimeout(() => process.kill(process.pid, 'SIGKILL'), 30000);
Run node host.js.
Observed: after the host dies, heft run-watch keeps running forever with ppid 1. Inside it, process.connected === false and there are no 'disconnect' listeners; its file watchers keep the event loop alive, so it holds its memory indefinitely. The same happens after cp.disconnect(). In a large monorepo where a Rush plugin hosts many such IPC watchers, a crashed or OOM-killed host left orphaned watcher groups totaling ~19-33 GB RSS.
Expected: when the IPC host's channel closes, the watch loop ends and heft exits, the same as on the host's exit command.
Suggested fix: in WatchLoop.runIPCAsync, add host.once('disconnect', () => resolve()) (or reject with an error) next to the 'message' handler, so a lost host is treated like the exit command.
Happy to test a candidate fix.
- 主要语言
- TypeScript
- 星标
- 6.5k
- 派生
- 710
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 45
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/rushstack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
[rush] Upgrade the pnpm-sync-lib dependency to 0.3.5.可能已有人在做 @martinnaj 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/rushstack#5971 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/rushstack#5902 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/rushstack#5839 · 1 个 reaction ·
维护者通常 1 天内回复
查看 microsoft/rushstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
cockpit-project/cockpit-machines#2835 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
cloudflare/kumo#866 ·
维护者通常 1 天内回复
-
area:connector bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
environment: OPENCODE_API_KEY is described as a Console service account key, but a Go subscription key works可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
tester-army/e2e#1015 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复