Signal received (SIGTERM or SIGINT)
|
+-- 1. Stop accepting new HTTP connections (listener.Close)
|
+-- 2. Wait for in-flight HTTP requests to complete (30s timeout)
| +-- If timeout: force-close remaining connections, log warning
|
+-- 3. Shutdown loaded engine plugins
| +-- Call Shutdown() on each loaded engine (5s timeout per engine)
|
+-- 4. Stop the reaper goroutine
|
+-- 5. Flush pending audit events
| +-- Drain the dispatcher queue (10s timeout)
|
+-- 6. Close database connections
| +-- SQLite: checkpoint WAL, close
| +-- PostgreSQL: close connection pool
|
+-- 7. Exit 0