From: Eric Wong Date: Fri, 24 May 2024 00:56:37 +0000 (+0000) Subject: git: don't break from event loop if cat-file fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc0fda3a16c7cbb64c7420d0500d502ac8d95afb;p=thirdparty%2Fpublic-inbox.git git: don't break from event loop if cat-file fails `git cat-file' can OOM or fail by other means. Don't let it bring down the event loop with an uncaught exception. --- diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index a9a821adf..ff38efa16 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -639,7 +639,8 @@ sub event_step { my ($self) = @_; my $inflight = gcf_inflight($self); if ($inflight && @$inflight) { - $self->cat_async_step($inflight); + eval { $self->cat_async_step($inflight) }; + warn "E: $self->{git_dir}: $@" if $@; return $self->close unless $self->{sock}; # don't loop here to keep things fair, but we must requeue # if there's already-read data in pi_io_rbuf