From 9982ab0a654d3898d6e27cab27bbd91171fd0d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20=C3=89LIE?= Date: Sat, 9 Dec 2023 22:30:15 +0100 Subject: [PATCH] ovsqlite-util: Fix database lock issue (timeout) Raise the busy timeout value to the same as the one of ovsqlite-server. The DBD::SQLite default is 30 seconds, and is not enough when the transtimelimit setting in ovsqlite.conf is higher than this value. Thanks to Jesse Rehmer for the bug report and Bo Lindbergh for the fix. close #282 --- doc/pod/news.pod | 7 +++++++ storage/ovsqlite/ovsqlite-util.in | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/doc/pod/news.pod b/doc/pod/news.pod index 1a8110970..0a06460e5 100644 --- a/doc/pod/news.pod +++ b/doc/pod/news.pod @@ -98,6 +98,13 @@ flag) which had not the expected native LF line termination. =item * +Fixed a database lock issue when running B on a running server +with the I parameter in F set to a higher value +than the default busy timeout of 30 seconds of B. Thanks to +Jesse Rehmer for the bug report and Bo Lindbergh for the fix. + +=item * + B no longer malfunctions nor throttles when the maximum number of file descriptors supported by the system is reached. If needing to use more file descriptors than the default system limit, a new C option diff --git a/storage/ovsqlite/ovsqlite-util.in b/storage/ovsqlite/ovsqlite-util.in index f86b8392e..30fba71e8 100644 --- a/storage/ovsqlite/ovsqlite-util.in +++ b/storage/ovsqlite/ovsqlite-util.in @@ -107,6 +107,12 @@ my $dbh = DBI->connect( # To process multiple SQL statements in a do() handle. $dbh->{sqlite_allow_multiple_statements} = 1; +# Raise the busy timeout value to the same (huge) number of milliseconds +# that ovsqlite-server internally uses. This will prevent timeouts because +# of database locks when transtimelimit in ovsqlite.conf is set to a higher +# value than the default busy timeout value of 30 seconds. +$dbh->sqlite_busy_timeout(999999999); + # Check the specified newsgroup exists, and create appropriate SQL requests. if (defined($opt{'n'})) { my $groupid = get_groupid($opt{'n'});