about summary refs log tree commit homepage
path: root/lib/PublicInbox/OverIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-01 00:33:15 +0000
committerEric Wong <e@80x24.org>2022-10-01 09:07:51 +0000
commitfa04201baae9d1043e37cf8ef4e5a33fdd0498ff (patch)
treefc175fde7733450fe92318206e787975d97948e2 /lib/PublicInbox/OverIdx.pm
parentf9ac22a4b485ae5f8ad981027d8608c13f09530e (diff)
downloadpublic-inbox-fa04201baae9d1043e37cf8ef4e5a33fdd0498ff.tar.gz
lei: force --jobs=1,1 for SQLite < 3.8.3
SQLite prior to 3.8.3 did not reset its PRNG for generating
unique temporary file names, so it would barf on t/lei-up.t
occasionally due to O_EXCL -> EEXIST conflicts.

This fixes occasional test failures under CentOS 7.x which ships
SQLite 3.7.17.
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r--lib/PublicInbox/OverIdx.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm
index e7c96e14..a49ca6db 100644
--- a/lib/PublicInbox/OverIdx.pm
+++ b/lib/PublicInbox/OverIdx.pm
@@ -670,4 +670,16 @@ sub vivify_xvmd {
         $smsg->{-vivify_xvmd} = \@vivify_xvmd;
 }
 
+sub fork_ok {
+        return 1 if $DBD::SQLite::sqlite_version >= 3008003;
+        my ($opt) = @_;
+        my @j = split(/,/, $opt->{jobs} // '');
+        state $warned;
+        grep { $_ > 1 } @j and $warned //= warn('DBD::SQLite version is ',
+                 $DBD::SQLite::sqlite_version,
+                ", need >= 3008003 (3.8.3) for --jobs > 1\n");
+        $opt->{jobs} = '1,1';
+        undef;
+}
+
 1;