user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 0/3] git: propagate die from async callbacks
@ 2021-10-08 10:20  7% Eric Wong
  2021-10-08 10:20  6% ` [PATCH 1/3] git: use async_wait_all everywhere Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-10-08 10:20 UTC (permalink / raw)
  To: meta

This should help us find and notice -extindex (and perhaps
-mda/-watch/lei) bugs more quickly.

Eric Wong (3):
  git: use async_wait_all everywhere
  git: async_abort includes --batch-check requests
  git: fatalize async callback errors by default

 lib/PublicInbox/Daemon.pm      |  2 ++
 lib/PublicInbox/Gcf2Client.pm  |  4 +--
 lib/PublicInbox/Git.pm         | 51 +++++++++++++++++++++-------------
 lib/PublicInbox/GitAsyncCat.pm |  4 +--
 lib/PublicInbox/LeiSearch.pm   |  4 +--
 lib/PublicInbox/LeiStore.pm    |  2 +-
 lib/PublicInbox/V2Writable.pm  |  6 ++--
 t/git.t                        | 28 +++++++++++++++++--
 xt/cmp-msgstr.t                |  2 +-
 xt/cmp-msgview.t               |  2 +-
 xt/eml_check_limits.t          |  2 +-
 xt/eml_octet-stream.t          |  2 +-
 xt/git_async_cmp.t             |  2 +-
 xt/msgtime_cmp.t               |  2 +-
 xt/perf-msgview.t              |  2 +-
 xt/perf-obfuscate.t            |  2 +-
 16 files changed, 77 insertions(+), 40 deletions(-)

^ permalink raw reply	[relevance 7%]

* [PATCH 1/3] git: use async_wait_all everywhere
  2021-10-08 10:20  7% [PATCH 0/3] git: propagate die from async callbacks Eric Wong
@ 2021-10-08 10:20  6% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-10-08 10:20 UTC (permalink / raw)
  To: meta

Some code paths may use maximum size checks, so ensure
any checks are waited on, too.
---
 lib/PublicInbox/LeiSearch.pm  | 4 ++--
 lib/PublicInbox/LeiStore.pm   | 2 +-
 lib/PublicInbox/V2Writable.pm | 6 +++---
 t/git.t                       | 4 ++--
 xt/cmp-msgstr.t               | 2 +-
 xt/cmp-msgview.t              | 2 +-
 xt/eml_check_limits.t         | 2 +-
 xt/eml_octet-stream.t         | 2 +-
 xt/git_async_cmp.t            | 2 +-
 xt/msgtime_cmp.t              | 2 +-
 xt/perf-msgview.t             | 2 +-
 xt/perf-obfuscate.t           | 2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm
index 568277a6f404..4e048e9a40b7 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 b4f40912aa61..52a1456fb415 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 36b84f5708ae..fcd7ffe2317b 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 844e0111f367..2a189eac6c40 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 900127c76cae..b6c8ec659ceb 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 49dcbc9ea3dd..9b06f88deade 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 536a25f159bd..a6d010af0518 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 8173aec2fd5e..3914f08970dc 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 a7a94c2debc3..d66b371ff760 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 ae9e42152a1a..a7ef5245bd8d 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 f97c06fb2e65..bc73fccea9a1 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 d4e7fb9929ec..640309d2cbc6 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');

^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-10-08 10:20  7% [PATCH 0/3] git: propagate die from async callbacks Eric Wong
2021-10-08 10:20  6% ` [PATCH 1/3] git: use async_wait_all everywhere Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).