]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
git: don't break from event loop if cat-file fails
authorEric Wong <e@80x24.org>
Fri, 24 May 2024 00:56:37 +0000 (00:56 +0000)
committerEric Wong <e@80x24.org>
Sat, 25 May 2024 23:27:59 +0000 (23:27 +0000)
`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

index a9a821adfe2e7f368bf4c8d9795c53e979b6e2d3..ff38efa16c7ea0a416c8924a5bfd9c35d0b4e7c8 100644 (file)
@@ -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