[PATCH b4 04/27] review: use the same busy timeout for both review databases
Christian Brauner <[email protected]> Fri, 31 Jul 2026 11:21:03 +0200
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <20260731-work-b4-editor-branch-guard-v1-4-de68a7c8e4cb@kernel.org> |
The messages database got a busy_timeout of 5s when it grew concurrent writers. The tracking database sitting next to it uses 15s and has the same two writers, the TUI and a "b4 review cron" sweep, doing the same short write transactions. There is no reason for the two to differ. All it means is that the flags database is the first to give up with "database is locked" when a cron sweep and an interactive session overlap. Use the same value. Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- src/b4/review/messages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/b4/review/messages.py b/src/b4/review/messages.py index a3a2d53..a73e986 100644 --- a/src/b4/review/messages.py +++ b/src/b4/review/messages.py @@ -44,8 +44,9 @@ def get_db() -> sqlite3.Connection: is_new = not os.path.exists(db_path) conn = sqlite3.connect(db_path) conn.row_factory = sqlite3.Row - # Both the TUI and 'b4 review cron' may write concurrently - conn.execute('PRAGMA busy_timeout = 5000') + # Both the TUI and 'b4 review cron' may write concurrently; same + # generous timeout the tracking database uses, for the same reason + conn.execute('PRAGMA busy_timeout = 15000') if is_new: conn.executescript(SCHEMA_SQL) conn.execute( -- 2.53.0