[PR #8604] [MERGED] fix(ci): stop the dev-launcher regression from hanging on macOS #8697

Closed
opened 2026-11-07 17:39:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8604
Author: @kolacheee
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-kicvis


📝 Commits (3)

  • 1972d5f fix(ci): stop the dev-launcher regression from hanging on macOS
  • cf07b30 fix(ci): let a stopped launcher regression clean up before it is killed
  • c66716b fix(ci): kill what is left of a stopped script's group once it exits

📊 Changes

3 files changed (+173 additions, -25 deletions)

View changed files

📝 package.json (+1 -1)
📝 scripts/regressions/dev-launcher-process.regression.mjs (+59 -24)
➕ scripts/run-launcher-regressions.mjs (+113 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8601

Why this change

  • The macOS jobs of Platform Artifact Checks sometimes go silent in pnpm regression:launcher-update and are cancelled at the 25-minute job limit. Since 10-22 this happened in 18 runs, on both macos-15 and macos-15-intel, and every time the log stops right after Dev launcher process regression checks passed., with two node processes left for cleanup.
  • So the hang is not in format-guard: the dev-launcher regression prints its last line and then never exits. Its "reuse a running server" case stops the launcher as soon as the client's fake pnpm logs its arguments, which it does just before it starts its worker. A stop in that gap can leave the worker running. The worker still holds the launcher's output pipe, so the regression keeps waiting on it.
  • The final cleanup should have caught it but could not: it skipped the fake pnpm because it was already dead, and kill(-<worker pid>) fails with ESRCH because the worker leads no process group. That error was swallowed without killing the worker itself.

What changed

  • dev-launcher-process.regression.mjs: the reuse and .env cases wait for their whole process trees before stopping the launcher, and afterwards check that every recorded process is gone, as the first two cases already did. Cleanup kills each recorded group and pid and drops its end of the launcher's output, so a leftover can no longer keep the script open. The script also runs that cleanup on SIGINT, SIGTERM and SIGHUP. Failure messages now list the processes still alive at the deadline, not at the start of the wait.
  • regression:launcher-update runs its eight scripts through the new scripts/run-launcher-regressions.mjs. It prints each script as it starts and gives each one 2 minutes (the whole step takes 21 to 34 s on recent green runs). On a timeout or Ctrl+C it sends SIGTERM to the script's process group so the script can clean up, then SIGKILLs whatever is left of the group once the script exits, or after 5 s if it hasn't. It names the script that timed out.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • pnpm regression:launcher-update passes on Linux (Node 24), with a START/PASS line per script.
  • Reproduced the hang on the old regression by making the reuse case's client worker ignore SIGTERM: it printed "passed", then hung until killed, with the worker left orphaned. With this change the same setup fails in 15 s with Launcher shutdown while reusing a server left descendants alive: <pid> and leaves nothing running.
  • Ran the fixed dev-launcher regression 18 times, three at a time: all passed.
  • Runner stops (all left no processes behind): a script that never exits, timed out at 2–3 s. The dev-launcher regression, timed out at 1.5, 3, 5 and 8 s and interrupted with SIGINT at 3, 7 and 11 s (exit 130). A variant whose worker ignores SIGTERM, timed out at 3 and 5 s. A script whose non-detached child ignores SIGTERM, after both a timeout and a SIGINT.
  • Not yet seen on macOS itself; the macOS jobs of this PR's checks are the real test.
  • The red audit check is unrelated: new minimatch/glob advisories, see the comment below.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8604 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-kicvis` --- ### 📝 Commits (3) - [`1972d5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1972d5f7260f1a9f7828ce6a34281cb63755cc41) fix(ci): stop the dev-launcher regression from hanging on macOS - [`cf07b30`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf07b30b16f43e409c443f300326f624c453268a) fix(ci): let a stopped launcher regression clean up before it is killed - [`c66716b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c66716ba76df40f6c517bb9a9fa81f466e267626) fix(ci): kill what is left of a stopped script's group once it exits ### 📊 Changes **3 files changed** (+173 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `scripts/regressions/dev-launcher-process.regression.mjs` (+59 -24) ➕ `scripts/run-launcher-regressions.mjs` (+113 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8601 ## Why this change - The macOS jobs of Platform Artifact Checks sometimes go silent in `pnpm regression:launcher-update` and are cancelled at the 25-minute job limit. Since 10-22 this happened in 18 runs, on both `macos-15` and `macos-15-intel`, and every time the log stops right after `Dev launcher process regression checks passed.`, with two `node` processes left for cleanup. - So the hang is not in format-guard: the dev-launcher regression prints its last line and then never exits. Its "reuse a running server" case stops the launcher as soon as the client's fake pnpm logs its arguments, which it does just before it starts its worker. A stop in that gap can leave the worker running. The worker still holds the launcher's output pipe, so the regression keeps waiting on it. - The final cleanup should have caught it but could not: it skipped the fake pnpm because it was already dead, and `kill(-<worker pid>)` fails with ESRCH because the worker leads no process group. That error was swallowed without killing the worker itself. ## What changed - `dev-launcher-process.regression.mjs`: the reuse and `.env` cases wait for their whole process trees before stopping the launcher, and afterwards check that every recorded process is gone, as the first two cases already did. Cleanup kills each recorded group and pid and drops its end of the launcher's output, so a leftover can no longer keep the script open. The script also runs that cleanup on SIGINT, SIGTERM and SIGHUP. Failure messages now list the processes still alive at the deadline, not at the start of the wait. - `regression:launcher-update` runs its eight scripts through the new `scripts/run-launcher-regressions.mjs`. It prints each script as it starts and gives each one 2 minutes (the whole step takes 21 to 34 s on recent green runs). On a timeout or Ctrl+C it sends SIGTERM to the script's process group so the script can clean up, then SIGKILLs whatever is left of the group once the script exits, or after 5 s if it hasn't. It names the script that timed out. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `pnpm regression:launcher-update` passes on Linux (Node 24), with a START/PASS line per script. - Reproduced the hang on the old regression by making the reuse case's client worker ignore SIGTERM: it printed "passed", then hung until killed, with the worker left orphaned. With this change the same setup fails in 15 s with `Launcher shutdown while reusing a server left descendants alive: <pid>` and leaves nothing running. - Ran the fixed dev-launcher regression 18 times, three at a time: all passed. - Runner stops (all left no processes behind): a script that never exits, timed out at 2–3 s. The dev-launcher regression, timed out at 1.5, 3, 5 and 8 s and interrupted with SIGINT at 3, 7 and 11 s (exit 130). A variant whose worker ignores SIGTERM, timed out at 3 and 5 s. A script whose non-detached child ignores SIGTERM, after both a timeout and a SIGINT. - Not yet seen on macOS itself; the macOS jobs of this PR's checks are the real test. - The red `audit` check is unrelated: new minimatch/glob advisories, see the comment below. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8697
No description provided.