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

sqldb/v2: align sqlite idle defaults

Public commit record

What the developer wrote

Authored by yyforyongyu

90/100 · Strong
sqldb/v2: align sqlite idle defaults

Keep SQLite's default idle connection limit aligned with the
open connection limit so the default pool matches v1 behavior.

This is a follow-up regression fix to the restored open-connection
default in e263ea145. After that change, SQLite again defaulted to
SetMaxOpenConns(2), but SetMaxIdleConns still fell back to 6. Go
silently caps idle connections at the open limit, so nothing
crashed, but the configured idle default became misleading and no
longer matched v1.

Use cfg.MaxConns() as the inherited idle default, keep the
explicit MaxIdleConnections override, and add unit coverage for
the default and override cases. The mismatch was easy to miss
because the code still compiled and basic tests did not assert the
effective idle 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 minor configuration mismatch in how LND's new SQLite database layer (v2) manages its connection pool. Previously, the default number of idle connections was set to 6, while the default number of open connections was only 2. Go's database library silently limits idle connections to the open-connection cap, so the effective idle pool was already 2, but the configured default was misleading and differed from the older v1 behavior. The change makes the idle default inherit the open-connection default unless the user explicitly overrides it, and adds tests. It is not a security vulnerability.

Recommended action

No security action required. Treat as a normal code-quality/configuration regression fix. Reviewers may verify that the new MaxIdleConns() helper is used consistently and that tests pass.

Security signals we found

01

No security-relevant signals in commit message or diff

02

Change is described as a regression fix for default configuration parity, not a security fix

03

No input validation, privilege boundary, cryptographic, or network changes

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/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.