No description
Find a file
jedarden 001c17bd85 feat: implement 10-step SIGTERM graceful shutdown sequence
Implements the full ordered shutdown sequence so the mothership drains
cleanly without data loss on SIGTERM (Docker stop, Kubernetes termination).

Shutdown sequence (30s hard deadline):
1. Set shutting_down=true; ingestion server returns HTTP 503 to new WebSocket upgrade requests
2. Broadcast {type:'shutdown', reconnect_in_ms:30000} to all dashboard WebSocket clients
3. Cancel fusion loop context (stops fusion goroutine)
4. Drain signal processing pipeline: wait for in-flight CSI frames (max 2s)
5. Flush in-memory baselines to SQLite in a single transaction
6. Sync CSI recording buffer to disk (close writer, fsync)
7. Close all node WebSocket connections with normal close frame (1000)
8. Write {type:'system', description:'Mothership stopped'} event to events table
9. PRAGMA wal_checkpoint(FULL) to collapse WAL into main DB file
10. sqlite3.Close()

Each step gets its own log line: '[SHUTDOWN] Step N/10 — ...'
Steps that fail log ERROR but do not abort remaining steps.
Exit code 0 if all steps completed within deadline; exit code 1 if deadline exceeded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 11:51:38 -04:00
.beads feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
.marathon ci: set VERSION to 0.1.0 for image build 2026-04-06 08:53:25 -04:00
dashboard feat: process buffered events from delta WebSocket updates 2026-04-07 11:04:49 -04:00
docs init: spaxel project — docs, plan, and marathon infrastructure 2026-03-26 06:43:25 -04:00
firmware feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
mothership feat: implement 10-step SIGTERM graceful shutdown sequence 2026-04-07 11:51:38 -04:00
.dockerignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.gitignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.needle-predispatch-sha feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
.needle.yaml feat: trigger CI build and verify deployment 2026-04-06 09:54:08 -04:00
docker-compose.yml feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
Dockerfile feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
PROGRESS.md feat(mothership): signal processing package with phase/baseline/motion detection 2026-03-26 08:08:46 -04:00
VERSION ci: auto-bump version to 0.1.56 2026-04-07 15:39:03 +00:00