AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 25 Bitcoin

sqldb/v2: restore sqlite conn limit

Public commit record

What the developer wrote

Authored by yyforyongyu

90/100 · Strong
sqldb/v2: restore sqlite conn limit

Restore the low default SQLite connection limit used in v1 so
the v2 store does not default to a Postgres-sized pool.

This is a real v2 regression from v1. The v1 store defines
DefaultSqliteMaxConns = 2 and routes SetMaxOpenConns through
cfg.MaxConns(), while v2 had fallen back to the generic
defaultMaxConns = 25. That change did not break compilation, but
it quietly changed runtime pool sizing in a way that is hostile
to SQLite's single-writer concurrency model and can increase lock
contention.

Add a small config helper and unit test so callers can still
override the limit explicitly while the default remains safe for
SQLite. The regression was easy to miss because existing tests
did not assert the effective default pool sizing.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a regression in LND's new v2 SQL database layer. The v2 code accidentally used a 25-connection pool for SQLite, matching PostgreSQL defaults, instead of the v1 value of 2. SQLite handles writes poorly with many concurrent connections, so this change restores the low default to reduce lock contention and resource use. It is a reliability/performance fix, not a security vulnerability that can be directly exploited by an attacker.

Recommended action

Treat as a normal reliability/performance fix. No urgent security action required. Users running v2 SQLite stores should upgrade to avoid lock contention and degraded performance under load.

Security signals we found

01

No security-relevant signals in diff: no input handling, crypto, auth, or network changes

02

Fix is framed by author as performance/reliability regression, not security

03

Change reduces resource contention and operational instability

Risk score

Why this scored 25/100

Our methodology →
Potential impact 5/30
Exploitability 0/25
Stealth signal 3/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.