]> Sergey Matveev's repositories - public-inbox.git/commitdiff
git: use async_wait_all everywhere
authorEric Wong <e@80x24.org>
Fri, 8 Oct 2021 10:20:02 +0000 (10:20 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Oct 2021 21:23:28 +0000 (21:23 +0000)
Some code paths may use maximum size checks, so ensure
any checks are waited on, too.

12 files changed:
lib/PublicInbox/LeiSearch.pm
lib/PublicInbox/LeiStore.pm
lib/PublicInbox/V2Writable.pm
t/git.t
xt/cmp-msgstr.t
xt/cmp-msgview.t
xt/eml_check_limits.t
xt/eml_octet-stream.t
xt/git_async_cmp.t
xt/msgtime_cmp.t
xt/perf-msgview.t
xt/perf-obfuscate.t

index 568277a6f40443217494e383b609f83f9c5d571f..4e048e9a40b7a9f2794d067eeef15f750b0d1d61 100644 (file)
@@ -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;
 }
 
index b4f40912aa61e5e6d1722105b1b53a30df4f228c..52a1456fb41544e4bee7ad21c1a0f662bc59d13c 100644 (file)
@@ -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;
 }
index 36b84f5708ae27ff52e01d082b630bbdb1c439a9..fcd7ffe2317ba518d06ff3faf3d8328600d4d1a1 100644 (file)
@@ -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 844e0111f367fe10e6a037126ac9f0e7be1bd2f4..2a189eac6c40835fa62a81024bed194fdebc48ac 100644 (file)
--- 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');
 
index 900127c76cae85dcbc033308105196a4e3c220fd..b6c8ec659cebcee4ac7e6e62a86fcfe06b896151 100644 (file)
@@ -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");
index 49dcbc9ea3dd0cfacc4e94de69567220bece7587..9b06f88deade239f5257de99b96bf4eec2ed98dc 100644 (file)
@@ -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');
 
index 536a25f159bd592b36828db19143f62d799c1f2d..a6d010af0518f3f8866eebf0ee018bd336147f44 100644 (file)
@@ -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";
index 8173aec2fd5ef9ca88834aa65b3f0a5c2f64986a..3914f08970dc91c09f5ace572a9b79e79a23c943 100644 (file)
@@ -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;
index a7a94c2debc3810ffe295e2910c6a7af6d6389a5..d66b371ff760153d8b2ee5b8b560d734807953b9 100644 (file)
@@ -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 ];
 });
 
index ae9e42152a1afea811ea2daf1f1d513da81e863a..a7ef5245bd8de4f37343578fcf28d73ed11d7cb9 100644 (file)
@@ -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;
 
index f97c06fb2e65a0427fb2e4c8c738d3fb7e506e53..bc73fccea9a1ea9accf173a0981024b99d0b9e16 100644 (file)
@@ -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');
index d4e7fb9929ec13748e7634da0c09aad709b23aa7..640309d2cbc6f3fb2aa694f96950de28dc3173cb 100644 (file)
@@ -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');