Skip to content

Commit

Permalink
ovsqlite-util: Fix database lock issue (timeout)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Julien-Elie committed Dec 9, 2023
1 parent 31e64a5 commit 9982ab0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/pod/news.pod
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ flag) which had not the expected native LF line termination.

=item *

Fixed a database lock issue when running B<ovsqlite-util> on a running server
with the I<transtimelimit> parameter in F<ovsqlite.conf> set to a higher value
than the default busy timeout of 30 seconds of B<ovsqlite-util>. Thanks to
Jesse Rehmer for the bug report and Bo Lindbergh for the fix.

=item *

B<innd> 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<LARGE_FD_SETSIZE> option
Expand Down
6 changes: 6 additions & 0 deletions storage/ovsqlite/ovsqlite-util.in
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
Expand Down

0 comments on commit 9982ab0

Please sign in to comment.