about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-08 10:20:02 +0000
committerEric Wong <e@80x24.org>2021-10-08 21:23:28 +0000
commit13a2fcc724576a78d0955f64dc0f4494545153c3 (patch)
treee81ef19be921acb9963064c46923b80c7dc3d5df
parente46b24f437639e3c2cc19df4a2c875b56fe6fea7 (diff)
downloadpublic-inbox-13a2fcc724576a78d0955f64dc0f4494545153c3.tar.gz
Some code paths may use maximum size checks, so ensure
any checks are waited on, too.
-rw-r--r--lib/PublicInbox/LeiSearch.pm4
-rw-r--r--lib/PublicInbox/LeiStore.pm2
-rw-r--r--lib/PublicInbox/V2Writable.pm6
-rw-r--r--t/git.t4
-rw-r--r--xt/cmp-msgstr.t2
-rw-r--r--xt/cmp-msgview.t2
-rw-r--r--xt/eml_check_limits.t2
-rw-r--r--xt/eml_octet-stream.t2
-rw-r--r--xt/git_async_cmp.t2
-rw-r--r--xt/msgtime_cmp.t2
-rw-r--r--xt/perf-msgview.t2
-rw-r--r--xt/perf-obfuscate.t2
12 files changed, 16 insertions, 16 deletions
diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm
index 568277a6..4e048e9a 100644
--- a/lib/PublicInbox/LeiSearch.pm
+++ b/lib/PublicInbox/LeiSearch.pm
@@ -119,13 +119,13 @@ sub xoids_for {
                                 $git->cat_async($cur->{blob}, \&_cmp_1st,
                                                 [$chash, $xoids, $cur, $lms]);
                                 if ($min && scalar(keys %$xoids) >= $min) {
-                                        $git->cat_async_wait;
+                                        $git->async_wait_all;
                                         return $xoids;
                                 }
                         }
                 }
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
         scalar(keys %$xoids) ? $xoids : undef;
 }
 
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index b4f40912..52a1456f 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -305,7 +305,7 @@ sub remove_eml {
                         $git->cat_async($oidhex, \&_remove_if_local, $self);
                 }
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
         remove_docids($self, @docids);
         \@docids;
 }
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 36b84f57..fcd7ffe2 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -1031,7 +1031,7 @@ sub sync_prepare ($$) {
                         my $req = { %$sync, oid => $oid };
                         $self->git->cat_async($oid, $unindex_oid, $req);
                 }
-                $self->git->cat_async_wait;
+                $self->git->async_wait_all;
         }
         return 0 if $sync->{quit};
         if (!$regen_max) {
@@ -1113,7 +1113,7 @@ sub unindex_todo ($$$) {
                 $self->git->cat_async($1, $unindex_oid, { %$sync, oid => $1 });
         }
         close $fh or die "git log failed: \$?=$?";
-        $self->git->cat_async_wait;
+        $self->git->async_wait_all;
 
         return unless $sync->{-opt}->{prune};
         my $after = scalar keys %$unindexed;
@@ -1245,7 +1245,7 @@ sub xapian_only {
                         index_xap_step($self, $sync, $art_beg, 1);
                 }
         }
-        $self->git->cat_async_wait;
+        $self->git->async_wait_all;
         $self->{ibx}->cleanup;
         $self->done;
 }
diff --git a/t/git.t b/t/git.t
index 844e0111..2a189eac 100644
--- a/t/git.t
+++ b/t/git.t
@@ -61,7 +61,7 @@ use_ok 'PublicInbox::Git';
                 my ($bref, $oid_hex, $type, $size, $arg) = @_;
                 $missing = [ @_ ];
         }, $arg);
-        $gcf->cat_async_wait;
+        $gcf->async_wait_all;
         my ($bref, $oid_hex, $type, $size, $arg_res) = @$res;
         is_deeply([$oid_hex, $type, $size], \@x, 'got expected header');
         is($arg_res, $arg, 'arg passed to cat_async');
@@ -147,7 +147,7 @@ SKIP: {
                 # trigger cat_async_retry:
                 $gcf->cat_async($remote, $cb, $results);
         }
-        $gcf->cat_async_wait;
+        $gcf->async_wait_all;
         my $expect = [ @exist[0..3], [ $remote, 'blob', 5 ], @exist[4..5] ];
         is_deeply($results, $expect, 'got expected results');
 
diff --git a/xt/cmp-msgstr.t b/xt/cmp-msgstr.t
index 900127c7..b6c8ec65 100644
--- a/xt/cmp-msgstr.t
+++ b/xt/cmp-msgstr.t
@@ -100,7 +100,7 @@ my $t = timeit(1, sub {
                 ++$n;
                 $git->cat_async($oid, $git_cb);
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
 });
 is($m, $n, "$inboxdir rendered all $m <=> $n messages");
 is($ndiff, 0, "$inboxdir $ndiff differences");
diff --git a/xt/cmp-msgview.t b/xt/cmp-msgview.t
index 49dcbc9e..9b06f88d 100644
--- a/xt/cmp-msgview.t
+++ b/xt/cmp-msgview.t
@@ -84,7 +84,7 @@ my $t = timeit(1, sub {
                 ++$n;
                 $git->cat_async($oid, $git_cb);
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
 });
 is($m, $n, 'rendered all messages');
 
diff --git a/xt/eml_check_limits.t b/xt/eml_check_limits.t
index 536a25f1..a6d010af 100644
--- a/xt/eml_check_limits.t
+++ b/xt/eml_check_limits.t
@@ -67,7 +67,7 @@ my $t = timeit(1, sub {
                 ++$n;
                 $git->cat_async($blob, $cat_cb);
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
 });
 is($m, $n, 'scanned all messages');
 diag "$$ $inboxdir took ".timestr($t)." for $n <=> $m messages";
diff --git a/xt/eml_octet-stream.t b/xt/eml_octet-stream.t
index 8173aec2..3914f089 100644
--- a/xt/eml_octet-stream.t
+++ b/xt/eml_octet-stream.t
@@ -69,7 +69,7 @@ while (<$cat>) {
         my ($oid, $type, $size) = split(/ /);
         $git->cat_async($oid, $cb) if $size && $type eq 'blob';
 }
-$git->cat_async_wait;
+$git->async_wait_all;
 note "$errs errors";
 note "$ok/$tot messages had text as application/octet-stream";
 ok 1;
diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t
index a7a94c2d..d66b371f 100644
--- a/xt/git_async_cmp.t
+++ b/xt/git_async_cmp.t
@@ -32,7 +32,7 @@ my $async = timeit($nr, sub {
                 $git->cat_async($oid, $cb);
         }
         close $cat or die "cat: $?";
-        $git->cat_async_wait;
+        $git->async_wait_all;
         push @dig, ['async', $dig->hexdigest ];
 });
 
diff --git a/xt/msgtime_cmp.t b/xt/msgtime_cmp.t
index ae9e4215..a7ef5245 100644
--- a/xt/msgtime_cmp.t
+++ b/xt/msgtime_cmp.t
@@ -64,7 +64,7 @@ while (<$fh>) {
         next if $type ne 'blob';
         $git->cat_async($oid, \&compare);
 }
-$git->cat_async_wait;
+$git->async_wait_all;
 ok(1);
 done_testing;
 
diff --git a/xt/perf-msgview.t b/xt/perf-msgview.t
index f97c06fb..bc73fcce 100644
--- a/xt/perf-msgview.t
+++ b/xt/perf-msgview.t
@@ -66,7 +66,7 @@ my $t = timeit(1, sub {
                         $git->cat_async($oid, $cb);
                 }
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
 });
 diag 'multipart_text_as_html took '.timestr($t)." for $n <=> $m messages";
 is($m, $n, 'rendered all messages');
diff --git a/xt/perf-obfuscate.t b/xt/perf-obfuscate.t
index d4e7fb99..640309d2 100644
--- a/xt/perf-obfuscate.t
+++ b/xt/perf-obfuscate.t
@@ -57,7 +57,7 @@ my $t = timeit(1, sub {
                 ++$n;
                 $git->cat_async($oid, $cb);
         }
-        $git->cat_async_wait;
+        $git->async_wait_all;
 });
 diag 'multipart_text_as_html took '.timestr($t)." for $n <=> $m messages";
 is($m, $n, 'rendered all messages');