Skip to content

fix(signal): prevent daemon overlap during restart - #107409

Merged
steipete merged 1 commit into
mainfrom
codex/fix-signal-daemon-stop
Jul 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-signal-daemon-stop

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #22676

What Problem This Solves

Fixes an issue where Signal users restarting or hot-reloading the gateway could start a replacement signal-cli daemon before the previous daemon released its HTTP port and config lock. That race caused orphaned processes, bind/lock failures, and failed message sends.

Why This Change Was Made

Signal daemon shutdown is now asynchronous and idempotent: it sends SIGTERM, escalates to SIGKILL after a bounded grace period, and resolves only after Node observes process exit. Signal monitor teardown stays alive until both the daemon exits and already-started reply work drains. Post-spawn signaling errors no longer masquerade as spawn failures and prematurely mark a live daemon exited.

The implementation preserves the newer readline-safe signal-cli output handling on current main and carries the original #71863 contributor as co-author.

User Impact

Signal gateway restarts no longer race the old daemon for its port or config lock. Graceful signal-cli cleanup remains preferred; stuck daemons are force-stopped before restart recovery proceeds.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added channel: signal Channel integration: signal size: S maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete
steipete merged commit 5688d90 into main Jul 14, 2026
112 of 115 checks passed
@steipete
steipete deleted the codex/fix-signal-daemon-stop branch July 14, 2026 11:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: signal Channel integration: signal maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Signal daemon stop() race condition on SIGUSR1 restart — orphaned processes and send failures

1 participant