Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[operation-graph] WatchLoop.runIPCAsync never exits when the IPC host disconnects, so heft run-watch outlives its host

未关闭 适合新手
#6,123 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/rushstack 的其他 Issue

查看 microsoft/rushstack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。