]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: fix undocumented --xapian-only
authorEric Wong <e@80x24.org>
Thu, 11 Mar 2021 10:45:38 +0000 (02:45 -0800)
committerEric Wong <e@80x24.org>
Thu, 11 Mar 2021 20:35:21 +0000 (16:35 -0400)
We can't pass $self and GLOBs across IPC channels transparently.
I only noticed this because I'm testing the application/octet-stream
fallback with https://public-inbox.org/meta/20210311014539.19756-1-e@80x24.org/

Fixes: bf8df8160076d7a1 ("searchidxshard: use PublicInbox::IPC to kill lots of code")
lib/PublicInbox/V2Writable.pm
t/v2reindex.t

index cbd4f003c6581d7121ead99be8b122e05ed25a0c..03590850973e0589000b29884d2f812759d128ae 100644 (file)
@@ -1216,7 +1216,7 @@ sub sync_ranges ($$) {
 
 sub index_xap_only { # git->cat_async callback
        my ($bref, $oid, $type, $size, $smsg) = @_;
-       my $self = $smsg->{self};
+       my $self = delete $smsg->{self};
        my $idx = idx_shard($self, $smsg->{num});
        $idx->index_eml(PublicInbox::Eml->new($bref), $smsg);
        $self->{transact_bytes} += $smsg->{bytes};
index 05ea952f43e1002f08028d5bb277208f816bb8d3..56540c8b1847bbd4ea7aad3d6c0f04cb14569781 100644 (file)
@@ -543,4 +543,9 @@ EOF
 $check_rethread->('3-headed-monster once');
 $check_rethread->('3-headed-monster twice');
 
+my $rdr = { 2 => \(my $err = '') };
+ok(run_script([qw(-index --reindex --xapian-only), $inboxdir], undef, $rdr),
+       '--xapian-only works');
+is($err, '', 'no errors from --xapian-only');
+
 done_testing();