Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[node-core-library] SubprocessTerminator ignores SIGHUP, so detached children outlive a closed terminal

オープン 初心者向け
#6,124 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript

調査の方向性

まず @rushstack/node-core-library パッケージの SubprocessTerminator、特に issue で挙げられている _ensureInitialized と _cleanupChildProcesses を読んでください。既存の SIGINT/SIGTERM の動作とそのテストを確認し、続いて Windows 以外で SIGHUP が処理され、クリーンアップされることを検証してください。端末を閉じた後、または 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日 13時間
マージ済み PR(30日)
45

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/rushstack のほかの issue

microsoft/rushstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。