Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Process-wide accounting for SQLite connections opened by AFT-owned seams.

The counter deliberately follows connection lifetime rather than query traffic: leaked SQLite handles keep file descriptors, WAL state, and page caches alive even while idle. Callers must use TrackedConnection at one of the documented seams.

Structs§

SqliteConnectionSnapshot
SqliteStoreCount
A store/count row is used instead of a map so status consumers can retain a stable schema even when every tracked count is zero.
TrackedConnection
A rusqlite::Connection whose lifetime contributes to the process-wide health census. It dereferences to Connection, keeping existing query APIs and transaction helpers unchanged while making close accounting automatic.

Enums§

SqliteStore
Names each production connection-opening seam so health can attribute a live connection without exposing cache-key paths in the process-wide report.

Constants§

SQLITE_UNINSTRUMENTED_OPENERS
Production rusqlite::Connection::open* call sites that intentionally do not pass through TrackedConnection. The list is empty today. Test-only fixture openers are excluded because they cannot affect daemon lifecycle health and are compiled out of release builds.

Functions§

connection_snapshot
Snapshot the current number of open connections. This takes a short counter lock only; OS/process enumeration remains outside this module.