about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-01 23:23:07 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-01 23:25:08 +0000
commit537eb7ec8c0f8ebd6fa39807a08515ccd3c4be66 (patch)
treeedf283aaaf4ab42eb488f3a6245aec9e78b0e2dd /lib/PublicInbox/V2Writable.pm
parentc34a83286234ea1e876ebdf92a33744272bb6f4e (diff)
downloadpublic-inbox-537eb7ec8c0f8ebd6fa39807a08515ccd3c4be66.tar.gz
I was too aggressively disabling parallelization to speed up
the test suite and broke this :x  Re-enable parallelization
for the v2reindex test so we can catch it later.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index c8869bda..51723e55 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -204,9 +204,13 @@ sub idx_init {
 
                 # need to create all parts before initializing msgmap FD
                 my $max = $self->{partitions} - 1;
-                @{$self->{idx_parts}} = map {
-                        PublicInbox::SearchIdxPart->new($self, $_, $skel);
-                } (0..$max);
+
+                # idx_parts must be visible to all forked processes
+                my $idx = $self->{idx_parts} = [];
+                for my $i (0..$max) {
+                        push @$idx,
+                             PublicInbox::SearchIdxPart->new($self, $i, $skel);
+                }
 
                 # Now that all subprocesses are up, we can open the FD for SQLite:
                 $skel->_msgmap_init->{dbh}->begin_work;