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 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
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
分支
714
平均合併
1 天 22 小時
30 天內合併 PR
37

環境準備

在 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 摘要。