Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite: specify a busy timeout #211

Merged
merged 1 commit into from
Aug 29, 2023
Merged

SQLite: specify a busy timeout #211

merged 1 commit into from
Aug 29, 2023

Conversation

moio
Copy link
Contributor

@moio moio commented Aug 28, 2023

Under stress, concurrent operations (notably while garbage collection is in progress) can result in failed calls with error SQLITE_BUSY (database is locked).

The SQLITE_BUSY result code is an expected outcome when the database file could not be written (or in some cases read) because of concurrent activity: https://www.sqlite.org/rescode.html

SQLite ships a busy timeout retry mechanism as a PRAGMA (https://www.sqlite.org/pragma.html#pragma_busy_timeout), that can be set via go-sqlite3's connection string.

That makes go-sqlite3 retry operations that fail with SQLITE_BUSY transparently to users.

Fixes k3s-io/k3s#8234

Under stress, concurrent operations (notably while garbage collection is in progress) can result in failed calls with error SQLITE_BUSY (database is locked).

The SQLITE_BUSY result code is an expected outcome when the database file could not be written (or in some cases read) because of concurrent activity: https://www.sqlite.org/rescode.html

SQLite ships a busy timeout retry mechanism as a PRAGMA (https://www.sqlite.org/pragma.html#pragma_busy_timeout), that can be set via go-sqlite3's connection string.

That makes go-sqlite3 retry operations that fail with SQLITE_BUSY transparently to users.

Fixes k3s-io/k3s#8234

Signed-off-by: Silvio Moioli <silvio@moioli.net>
@brandond brandond merged commit 08c19a7 into k3s-io:master Aug 29, 2023
1 check passed
brandond added a commit to johnatasr/k3s that referenced this pull request Sep 15, 2023
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
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.

database is locked during Rancher (moderate) stress test
2 participants