Runbook: daemon bus in-flight stuck
Alert source: packages/testkit/alerts/daemon.rules.yaml
Canonical markdown: docs/runbooks/daemon-bus-inflight-stuck.md
Severity: critical.
Symptom
bus_inflight is > 100 with a zero publish rate over 10 minutes. A
subscriber is hung and Promise.allSettled is waiting on it.
Likely cause
- An extension's subscriber callback never resolves (missing
await, infiniteawaiton a hung promise). - A channel adapter's outbound bridge is deadlocked awaiting a platform response that never comes.
- A plugin-contributed hook is blocking the bus.
Immediate mitigation
Restart the daemon:
declaragent down && declaragent up -d
Bus state is in-process — the restart drops the hung subscriber.
Root-cause investigation
# Daemon snapshot (agents + sources):
declaragent ps
curl -s http://127.0.0.1:9464/status | jq
# In-flight gauge:
curl -s http://127.0.0.1:9464/metrics | grep source_inflight
If the daemon had CPU profiling enabled, pull the profile and identify
the hung handler. Otherwise, reproduce locally while tailing
declaragent logs -f.
Post-incident
- Capture: hung subscriber id, cause, fix commit.
- Close when: publish rate resumes normal levels after restart.
- Post-mortem: mandatory — silent hangs are always a regression.