Commit Graph
1 Commits
Author SHA1 Message Date
Randy Marsden dcf881f1e8 fix: close leaked state.db read-only connections in session discoverability/recovery
Three sites used `with sqlite3.connect(f"file:...?mode=ro", uri=True) as conn:`,
which only scopes the transaction — sqlite3.Connection's context manager never
calls close(). Same recurring bug class as #1421/#1494/#2233/#3904. On a
long-lived server each poll leaked a state.db (+ -wal/-shm) fd until the
process hit macOS's 256 soft FD limit and writes started failing.

Wrap all three in contextlib.closing(), matching the pattern already used
elsewhere in these files.
2026-08-07 21:34:34 +00:00