fix: use detached:false in DaemonSupervisor.spawn() to preserve Aqua bootstrap namespace

Closed
AS
5mo ago
+10-4

Problem

When detached: true is passed to childProcess.spawn() in DaemonSupervisor.ts, Node.js calls setsid(), which creates a new process session and disconnects the process from the macOS Aqua launchd bootstrap namespace. This causes any GUI subprocess (Chromium via Playwright/Lighthouse) to fail with SIGABRT (bootstrap_check_in error 141).

Confirmed via launchctl managername returning "Could not get manager name" inside Superset terminal shells.

Root cause

Introduced in the April 2026 migration of the daemon supervisor from the Electron main process into packages/host-service. Previously spawned from Electron (Aqua session). Now spawned from host-service (ELECTRON_RUN_AS_NODE=1), and the additional setsid() from detached: true fully removes the Aqua bootstrap context.

The detached: true was intentional for PTY survival, but child.unref() (already called below) is sufficient — the daemon is reparented to launchd without needing a new session. setsid() is not needed and actively harmful here.

Change

detached: !isDev → detached: false (with explanatory comment)

Closes superset-sh/superset#5423


Open in Stage

Summary by CodeRabbit

  • Bug Fixes
    • Improved macOS daemon startup to ensure GUI-related subprocesses launch reliably under the system’s process launcher.
    • Refined process/session behavior so PTY and terminal interactions remain stable, without relying on macOS background detachment.