From cc0fda3a16c7cbb64c7420d0500d502ac8d95afb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 May 2024 00:56:37 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.2