about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-04-11 11:23:50 +0000
committerEric Wong <e@80x24.org>2023-04-11 17:10:39 +0000
commit4b1a8231d4bae0931d533b8b8ac8baa56d207d96 (patch)
tree576891bd6631c350b5f1fd34f1d07737693d37a5 /lib/PublicInbox/SearchIdx.pm
parentcbe2548c91859dfb923548ea85d8531b90d53dc3 (diff)
downloadpublic-inbox-4b1a8231d4bae0931d533b8b8ac8baa56d207d96.tar.gz
Retrying requests on alternates changing was causing inflight
requests to get lost due to {inflight} getting clobbered by
batch_prepare.

Unfortunately, reproducing this is difficult without mocking
->alternates_changed.

SearchIdx now avoids calling ->batch_prepare directly and
relies on more common API functions.

Fixes: 65db62eb006f ("git: use --batch-command in git 2.36+ to save processes")
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 496cea05..3415cce4 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -1074,7 +1074,11 @@ sub _index_sync {
         my $ibx = $self->{ibx};
         local $self->{current_info} = "$ibx->{inboxdir}";
         $self->{batch_bytes} = $opt->{batch_size} // $BATCH_BYTES;
-        $ibx->git->batch_prepare;
+
+        if ($X->{CLOEXEC_UNSET}) {
+                $ibx->git->cat_file($tip);
+                $ibx->git->check($tip);
+        }
         my $pr = $opt->{-progress};
         my $sync = { reindex => $opt->{reindex}, -opt => $opt, ibx => $ibx };
         my $quit = quit_cb($sync);