[node-core-library] SubprocessTerminator ignores SIGHUP, so detached children outlive a closed terminal
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 75/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
研究方向
先閱讀 @rushstack/node-core-library 套件中的 SubprocessTerminator,特別是 issue 中提到的 _ensureInitialized 和 _cleanupChildProcesses。檢查現有的 SIGINT/SIGTERM 行為及其測試,接著確認 SIGHUP 在非 Windows 系統上會受到處理並完成清理。完成標準是:關閉終端或收到 SIGHUP 後,重現步驟不再留下仍在執行的已分離子程序。
由索引模型根據 Issue 內容生成。
描述
🤖 Filed by GitHub Copilot acting for @namankanakiya (light review only).
Package: @rushstack/node-core-library 5.25.1. Linux/macOS (non-Windows).
Repro: script.js:
const { SubprocessTerminator } = require('@rushstack/node-core-library');
const c = require('child_process').spawn('sleep', ['1000'], SubprocessTerminator.RECOMMENDED_OPTIONS);
SubprocessTerminator.killProcessTreeOnExit(c, SubprocessTerminator.RECOMMENDED_OPTIONS);
setInterval(() => {}, 1000);
Run it in a terminal, then close the terminal (or kill -HUP <pid>).
Observed: sleep keeps running with ppid 1. RECOMMENDED_OPTIONS (detached: true) puts the child in its own session, so the terminal's hangup never reaches it, and killProcessTreeOnExit only handles SIGINT, SIGTERM and exit. With SIGINT or SIGTERM the child is killed as expected.
Expected: on non-Windows, SIGHUP is handled like SIGINT/SIGTERM, so closing the terminal of a tool that uses SubprocessTerminator does not leak its detached children.
Suggested fix: in _ensureInitialized, also process.prependListener('SIGHUP', _onTerminateSignal), and remove it in _cleanupChildProcesses.
Happy to test a candidate fix.
- 主要語言
- TypeScript
- 星號
- 6.5k
- 分支
- 710
- 平均合併
- 1 天 22 小時
- 30 天內合併 PR
- 37
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/rushstack 的其他 Issue
-
[api-extractor] Source map segment without a source crashes SourceMapper with "Target is a folder, not a file"可能已有人在做 @joshuaellis 於 5 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
[rush-serve-plugin] The auto-picked port never reaches the port parameter: `_value` is ignored since ts-command-line uses `#value`可能已有人在做 @b84330808 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
[rush] Upgrade the pnpm-sync-lib dependency to 0.3.5.可能已有人在做 @martinnaj 於 25 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
microsoft/rushstack#5971 · 2 則留言 ·
維護者通常 1 天內回覆
查看 microsoft/rushstack 的全部 Issue
相似的 Issue
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Japan Fact 898 (good-first-issue)未關閉community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難度 1/5 1 小時以內 新手友好度 86/100
lingdojo/kana-dojo#33145 · 1 則留言 · 5 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
code-yeongyu/senpi#4278 ·
維護者通常 1 天內回覆
-
[Bug] Activity | The activity list ignores taskIds and returns the activities of every task可能已有人在做 @NdekoCode 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
ever-co/ever-gauzy#11469 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
griffinwork40/agent-afk#4408 ·
維護者通常 1 天內回覆