You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(kernel-cli): log fatal exits from daemon-entry before terminating
daemon-entry runs with `stdio: 'ignore'` under the CLI spawner, so
Node's default behaviour on uncaughtException / unhandledRejection
(print stack to stderr, exit 1) writes to nowhere and the operator
sees only that the daemon vanished. Two recent debugging sessions
were consumed by silent daemon deaths that left no trace.
Install process-level handlers that append a synchronous log line
before the process exits:
- uncaughtException — captures stack, exits(1)
- unhandledRejection — captures reason, exits(1)
- SIGHUP — logs, exits(0) (default was silent terminate)
- exit — last-ditch record; fires on every exit path
Handlers are installed at module load, before main() runs, so
early kernel-init failures also leave a fingerprint. Each handler
uses only synchronous fs and the fs write is wrapped in try/catch
so a log-write failure never masks the original exit cause.
Copy file name to clipboardExpand all lines: packages/kernel-cli/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
20
### Fixed
21
21
22
22
-`kernel daemon start` refuses to start when another daemon is already listening on the same Unix socket, instead of unlinking the socket and orphaning the running process ([#952](https://github.com/MetaMask/ocap-kernel/pull/952))
23
+
- Daemon fatal-path visibility: `daemon-entry` now installs handlers for `uncaughtException`, `unhandledRejection`, `SIGHUP`, and `exit` that append a synchronous fingerprint line to `daemon.log` before terminating. Without these, silent daemon deaths under `stdio: 'ignore'` (the CLI's default spawn mode) left no trace in the log; the operator saw only that the daemon was gone. Every terminating path now leaves at least one line.
0 commit comments