feat(sync-service): Scale SQLite connection pool to 0#3908
feat(sync-service): Scale SQLite connection pool to 0#3908magnetised wants to merge 7 commits intomainfrom
Conversation
❌ 6 Tests Failed:
View the top 3 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 13: Two new commits since round 12 — What's Working Well
Issues FoundCritical (Must Fix)None. Important (Should Fix)1.
Still present. Default config ( Noting that the author has indicated they would prefer to move forward without this change — leaving it here for Alco's judgement. Suggestions (Nice to Have)2. Blacksmith 25 shell integration-test failures — still unresolved The 2026-03-02 CI run still shows 25 shell test failures. No new CI runs visible since the last push. Worth a quick sanity-check that these are pre-existing flakiness on 3.
4. Missing
5.
Issue ConformanceNo linked issue — same as all previous rounds. PR description is accurate and self-contained. Previous Review Status
Review iteration: 13 | 2026-03-03 |
|
@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
b316a68 to
d31116a
Compare
so stats retrieval is not blocked by concurrent reading of stats
and always use a pooled connection for the retreival
because now we're maybe shutting the write connection when idle, this will log all the time
d31116a to
872c8bd
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.