Skip to content

Exit promptly after parent death#781

Open
SS-42 wants to merge 1 commit into
DeusData:mainfrom
SS-42:fix/parent-watchdog-startup
Open

Exit promptly after parent death#781
SS-42 wants to merge 1 commit into
DeusData:mainfrom
SS-42:fix/parent-watchdog-startup

Conversation

@SS-42

@SS-42 SS-42 commented Jul 2, 2026

Copy link
Copy Markdown

Summary

This makes the parent-death watchdog exit immediately from the watchdog thread when the launching process disappears.

The previous path requested graceful shutdown from the watchdog thread. That can leave a stdio server alive long enough to keep the pipe open, and it also runs non-async-safe shutdown work from a thread whose only job is parent-death detection. The new path writes a short diagnostic directly to stderr and calls _exit(0).

The regression test now waits until startup reaches the watchdog-ready point before killing the wrapper, increases the timeout, and treats a zombie child as already exited.

Observed environment: macOS 26.5.2 (25F84), Darwin 25.5.0 arm64, Apple clang 21.0.0. This code path is POSIX-only; Windows remains under the existing #ifndef _WIN32 guard.

Test plan

  • make -f Makefile.cbm build/c/codebase-memory-mcp CC=clang CXX=clang++
  • tests/test_parent_watchdog.sh

@SS-42 SS-42 requested a review from DeusData as a code owner July 2, 2026 18:42
Signed-off-by: SS-42 <noreply@incogni.to>
@SS-42 SS-42 force-pushed the fix/parent-watchdog-startup branch from 8a8a1ce to f607c0f Compare July 2, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant