Skip to content

Commit 7cdfb0d

Browse files
committed
chore(sqlite): revert the busy_timeout pragmas
Internal Sentry reports tell us that enabling the busy_timeout seems to have *increased* the number of "database is busy" errors, instead of lowering those. As a result, we're going to disable the pragmas in all the places where we enabled it before, and observe how the number of "database is busy" errors evolves.
1 parent d8652d2 commit 7cdfb0d

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

crates/matrix-sdk-sqlite/src/event_cache_store.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,6 @@ impl SqliteEventCacheStore {
179179
async fn acquire(&self) -> Result<SqliteAsyncConn> {
180180
let connection = self.pool.get().await?;
181181

182-
// Specify a busy timeout so that operations are automatically retried, in case
183-
// the database was marked as locked, which can happen under very
184-
// peculiar circumstances in WAL mode.
185-
//
186-
// The timeout value is in milliseconds.
187-
//
188-
// See also https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode.
189-
connection.execute_batch("PRAGMA busy_timeout = 2000;").await?;
190-
191182
// Per https://www.sqlite.org/foreignkeys.html#fk_enable, foreign key
192183
// support must be enabled on a per-connection basis. Execute it every
193184
// time we try to get a connection, since we can't guarantee a previous

crates/matrix-sdk-sqlite/src/state_store.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -447,18 +447,7 @@ impl SqliteStateStore {
447447
}
448448

449449
async fn acquire(&self) -> Result<SqliteAsyncConn> {
450-
let conn = self.pool.get().await?;
451-
452-
// Specify a busy timeout so that operations are automatically retried, in case
453-
// the database was marked as locked, which can happen under very
454-
// peculiar circumstances in WAL mode.
455-
//
456-
// The timeout value is in milliseconds.
457-
//
458-
// See also https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode.
459-
conn.execute_batch("PRAGMA busy_timeout = 2000;").await?;
460-
461-
Ok(conn)
450+
Ok(self.pool.get().await?)
462451
}
463452

464453
fn remove_maybe_stripped_room_data(

0 commit comments

Comments
 (0)