[PR #283] [MERGED] fix(launcher): bound migration child-process hops + defer off boot path #4545

Closed
opened 2026-10-22 04:08:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/283
Author: @LukaTheHero
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @LukaTheHero

Base: main ← Head: fix/migration-bounded-and-deferred


📝 Commits (1)

  • 73e21f9 fix(launcher): bound migration child-process hops + defer off boot path

📊 Changes

2 files changed (+38 additions, -11 deletions)

View changed files

📝 packages/server/src/app.ts (+15 -8)
📝 packages/server/src/services/setup/taskbar-shortcut-migration.ts (+23 -3)

📄 Description

Summary

Review feedback on #282: the synchronous powershell.exe / COM shortcut hops in the taskbar migration ran on the server boot path. A stalled child could hold the server hostage indefinitely.

Two-layer defense

  1. Per-hop timeout — each spawnSync call now carries timeout: 5_000. On timeout Node sends SIGTERM and returns a non-zero exit, which the existing status checks already treat as a soft failure (skip the candidate, log a warning, continue).
  2. Off the boot path — the whole migrateTaskbarShortcuts(...) invocation in app.ts is wrapped in setImmediate(...). Even in the absolute worst case (every hop times out, ~25 s total across all candidates), the work runs after the server's already accepting connections.

Manual verification

  • Boot the server normally on Windows and confirm migration still runs (test .lnk gets re-pointed) — happy path measured at ~700 ms total.
  • Force a stall by holding the COM shortcut API (e.g. Get-CimInstance looped on the WMI service) and confirm the server still finishes booting on time; migration logs a warning instead of hanging.
  • Non-Windows host: still skipped silently (process.platform check unchanged).

No linked issue. Direct follow-up to the review comment on #282.

Summary by CodeRabbit

  • Bug Fixes

    • Added timeout protection to prevent background processes from indefinitely blocking server startup.
  • Refactor

    • Deferred taskbar shortcut operations to execute after server initialization.

🔄 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/283 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `fix/migration-bounded-and-deferred` --- ### 📝 Commits (1) - [`73e21f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73e21f92aa7b22eac9ea3d8a0ade0cd053e15f93) fix(launcher): bound migration child-process hops + defer off boot path ### 📊 Changes **2 files changed** (+38 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/app.ts` (+15 -8) 📝 `packages/server/src/services/setup/taskbar-shortcut-migration.ts` (+23 -3) </details> ### 📄 Description ## Summary Review feedback on #282: the synchronous `powershell.exe` / COM shortcut hops in the taskbar migration ran on the server boot path. A stalled child could hold the server hostage indefinitely. ## Two-layer defense 1. **Per-hop timeout** — each `spawnSync` call now carries `timeout: 5_000`. On timeout Node sends SIGTERM and returns a non-zero exit, which the existing status checks already treat as a soft failure (skip the candidate, log a warning, continue). 2. **Off the boot path** — the whole `migrateTaskbarShortcuts(...)` invocation in `app.ts` is wrapped in `setImmediate(...)`. Even in the absolute worst case (every hop times out, ~25 s total across all candidates), the work runs after the server's already accepting connections. ## Manual verification - [ ] Boot the server normally on Windows and confirm migration still runs (test `.lnk` gets re-pointed) — happy path measured at ~700 ms total. - [ ] Force a stall by holding the COM shortcut API (e.g. `Get-CimInstance` looped on the WMI service) and confirm the server still finishes booting on time; migration logs a warning instead of hanging. - [ ] Non-Windows host: still skipped silently (`process.platform` check unchanged). No linked issue. Direct follow-up to the review comment on #282. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Added timeout protection to prevent background processes from indefinitely blocking server startup. * **Refactor** * Deferred taskbar shortcut operations to execute after server initialization. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:35 +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#4545
No description provided.