feat(sync-service): Scale SQLite connection pool to 0#3908
feat(sync-service): Scale SQLite connection pool to 0#3908magnetised wants to merge 8 commits intomainfrom
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
72269af to
0c0a256
Compare
0c0a256 to
023caa8
Compare
Claude Code ReviewSummaryRound 15: One new commit since round 14 — "Cleanup after rebase" (b281e9b). It removes the What's Working Well
Issues FoundCritical (Must Fix)None. Important (Should Fix)1. File: Issue: SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'dbstat'
Why the test does not catch this: Suggested fix: probe dbstat_available? =
if dbstat_available? do
case Connection.fetch_one(conn, "SELECT 1 FROM dbstat LIMIT 1", []) do
{:ok, _} -> true
:error -> true # 0 rows but table exists -- empty db
_error ->
if first_run?,
do: Logger.warning("SQLite disk size statistics will not be available.")
false
end
else
false
end( Suggestions (Nice to Have)2. Three dead state fields left over from File:
3. File: The cleanup commit replaced the previous Issue ConformanceNo linked issue — unchanged from all previous rounds. Previous Review Status
Review iteration: 15 | 2026-03-04 |
|
@magnetised I've looked through the issues Claude flagged up, all for them look legit. Please ping me when ready for another review round. |
023caa8 to
90029c5
Compare
This comment has been minimized.
This comment has been minimized.
90029c5 to
f8fa293
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
df9efb8 to
292b144
Compare
|
@alco think we can ignore claude's suggestions. ready for another look pls |
9772e20 to
3d410a6
Compare
This comment has been minimized.
This comment has been minimized.
packages/sync-service/lib/electric/shape_cache/shape_status/shape_db/connection.ex
Outdated
Show resolved
Hide resolved
packages/sync-service/lib/electric/shape_cache/shape_status/shape_db/connection.ex
Outdated
Show resolved
Hide resolved
packages/sync-service/lib/electric/shape_cache/shape_status/shape_db/connection.ex
Outdated
Show resolved
Hide resolved
812f743 to
e95c5ae
Compare
524f5f8 to
b316a68
Compare
d31116a to
872c8bd
Compare
|
Found 4 test failures on Blacksmith runners: Failures
|
so stats retrieval is not blocked by concurrent reading of stats
because now we're maybe shutting the write connection when idle, this will log all the time
872c8bd to
b281e9b
Compare
NimblePool allows for lazy initialization and scale down of SQLite connections. This PR adds support for that.
The scaling is disabled for exclusive_mode as an exclusive_mode db could be in-memory, and closing that would be catastrophic.
I've added the number of active connections to the exported data. Will be interesting to see what goes on there, in both the larger instances and the many less-active ones.
This disables sqlite statistics collection by default as the usefulness of the exported numbers is low without memory statistics enabled, and enabling memory stats is potentially causing issues in some deployments.