From 9a0d173ead1b44d6a8e9eac624852cd007ef9ac5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 6 Jul 2021 12:42:03 +0000 Subject: extindex: --gc: avoid SQLite lock conflict on shard cleanup Xapian shard cleanup only requires read-only access to over.sqlite3, so avoid opening it with read-write access since create_tables will hit lock conflicts on "INSERT OR IGNORE" statements. --- lib/PublicInbox/SearchIdxShard.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm index 1598faeb..8635f585 100644 --- a/lib/PublicInbox/SearchIdxShard.pm +++ b/lib/PublicInbox/SearchIdxShard.pm @@ -78,8 +78,9 @@ sub shard_close { sub shard_over_check { my ($self, $over) = @_; if ($self->{-ipc_req} && $over->{dbh}) { - # can't send DB handles over IPC - $over = ref($over)->new($over->{dbh}->sqlite_db_filename); + # can't send DB handles over IPC, and use read-only to avoid + # create_tables lock conflict: + $over = PublicInbox::Over->new($over->{dbh}->sqlite_db_filename) } $self->ipc_do('over_check', $over); } -- cgit v1.2.3-24-ge0c7