Skip to content

Conversation

@aruiz14
Copy link
Contributor

@aruiz14 aruiz14 commented Nov 28, 2025

Issue: rancher/rancher#52872

Detect SQLITE_BUSY and SQLITE_BUSY_SNAPSHOT which can happen normally on a concurrent system using WAL mode. Retry them automatically, since that specific case won't be managed by the busy handler.

Note: BeginTx returns a *sql.Tx which does not expose any public field, so I have to introduce a new interface in order to be able to mock it for my unit tests. Other kind of testing would be challenging since this patch is meant to mitigate a possible race condition.

@aruiz14 aruiz14 requested a review from a team as a code owner November 28, 2025 16:43
@aruiz14 aruiz14 force-pushed the retry-withTransaction-on-busy-errors branch from 0f5adc0 to 83df783 Compare November 28, 2025 16:48
@aruiz14 aruiz14 force-pushed the retry-withTransaction-on-busy-errors branch from 83df783 to 81d72c7 Compare December 9, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant