fix(loader-server): a watch restart forks the new worker before the old one exits
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bun, node.js, typescript
- 領域
- backend
調査の方向性
Start with apps/server/src/server.ts at the cited restart path, then trace how the child worker is forked and how restart is triggered. Check the project’s existing process and logging tests, if present. Done means restart waits for the old worker to exit before forking, kills it after a timeout if needed, and logs child exit and error events.
索引モデルが issue の本文から書いたものです。
説明
Which app is this bug report for?
server
Issue description
On restart, child.kill() only sends SIGTERM and fork runs right after (server.ts#L43-L50).
- If the old game server still holds its port (4444/4445 in
nf new --serverprojects), the new worker fails withEADDRINUSE. - If a game ignores SIGTERM, the old worker is never killed.
- No
exit/errorhandler is attached to the child, so worker crashes go unreported (the editor isn't told either).
Found by reading the code path (not reproduced).
Expected: the new worker starts only once the old one has exited, and worker exits and errors are logged.
Suggested fix: wait for the old child's exit event (SIGKILL after a timeout) before forking, and log exit and error.
Found during a read-only audit of main @ 044c766 (2026-11-11).
Code sample
if (child) {
child.kill(); // SIGTERM, not awaited
child = undefined;
}
child = fork(join(dirname(__filename), "worker.js"), ...);
Versions
- @nanoforge-dev/loader-client / @nanoforge-dev/loader-server / @nanoforge-dev/loader-website 1.7.0 (
main@ 044c766) - Bun 1.3.14
- Linux x86_64
Issue priority
Medium (should be fixed soon)
I have tested this issue on a development release
044c766
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 0
- 平均マージ
- 17時間 25分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NanoForge-dev/Loader のほかの issue
-
app:client app:website enhancement refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NanoForge-dev/Loader#145 ·
メンテナーはふだん 1 日以内に返信
-
chore(loader-client,loader-server): package.json entry points name files the build does not produceオープンapp:client app:server bug chore good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NanoForge-dev/Loader#144 ·
メンテナーはふだん 1 日以内に返信
-
app:website bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NanoForge-dev/Loader#141 ·
メンテナーはふだん 1 日以内に返信
-
app:website bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanoForge-dev/Loader#140 ·
メンテナーはふだん 1 日以内に返信
-
app:server bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NanoForge-dev/Loader#138 ·
メンテナーはふだん 1 日以内に返信
NanoForge-dev/Loader の issue をすべて見る
似ている issue
-
Mend: dependency security vulnerability
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
fdm-monster/fdm-monster#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
growilabs/growi#12246 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SSWConsulting/SSW.Rules#2809 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信