codemap icon indicating copy to clipboard operation
codemap copied to clipboard

watch: a stopped (SIGSTOP) daemon blocks the hook's restart, leaving no daemon that session

Open JordanCoin opened this issue 1 month ago • 1 comments

If the watch daemon is stopped (SIGSTOP, e.g. suspended by the OS or a debugger) and has no state, the session-start hook correctly decides to restart it, but the stop hangs: the SIGTERM stays pending on the stopped process, the hook runs out its time budget, and no new daemon starts that session. Main takes the same path.

Repro: start a daemon, kill -STOP <pid>, remove .codemap/state.json, run the session-start hook. The hook times out, and the old pid is still there, stopped.

Expected: the stop path sends SIGCONT after SIGTERM (or escalates to SIGKILL after a short wait) and verifies the process is gone, so a fresh daemon starts.

Part of the daemon ownership and reaping gap in #155. Found while verifying #277.

JordanCoin avatar Nov 04 '26 07:11 JordanCoin

I'd like to work on this. I reproduced the stopped-daemon restart failure and will open a PR shortly.

gezerui888 avatar Nov 04 '26 19:11 gezerui888