* [PATCH 04/64] git: async: loop inflight checks for nested callbacks
@ 2020-10-16 6:59 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2020-10-16 6:59 UTC (permalink / raw)
To: meta
We need to loop the inflight check for nested callback
invocations to ensure we don't clog the pipe that feeds
`git cat-file'.
This bug was obscured by the fact that we're already
accounting for 64-char git OIDs with SHA-256 in the
pipe space calculation; perhaps we shouldn't do that.
---
lib/PublicInbox/Git.pm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index eb5de159..e3a2bcb8 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -275,7 +275,7 @@ sub check_async_begin ($) {
sub check_async ($$$$) {
my ($self, $oid, $cb, $arg) = @_;
my $inflight_c = $self->{inflight_c} // check_async_begin($self);
- if (scalar(@$inflight_c) >= MAX_INFLIGHT) {
+ while (scalar(@$inflight_c) >= MAX_INFLIGHT) {
check_async_step($self, $inflight_c);
}
print { $self->{out_c} } $oid, "\n" or fail($self, "write error: $!");
@@ -420,10 +420,9 @@ sub cat_async_begin {
sub cat_async ($$$;$) {
my ($self, $oid, $cb, $arg) = @_;
my $inflight = $self->{inflight} // cat_async_begin($self);
- if (scalar(@$inflight) >= MAX_INFLIGHT) {
+ while (scalar(@$inflight) >= MAX_INFLIGHT) {
cat_async_step($self, $inflight);
}
-
print { $self->{out} } $oid, "\n" or fail($self, "write error: $!");
push(@$inflight, $oid, $cb, $arg);
}
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-10-16 6:59 [PATCH 01/64] inbox: add uidvalidity method Eric Wong
2020-10-16 6:59 7% ` [PATCH 04/64] git: async: loop inflight checks for nested callbacks 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).