From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0862F1F566 for ; Fri, 24 May 2024 00:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1716512199; bh=zIY4ZYC+CvkZEpb+k7XoKSIexGyyyAYLNmazv5+FL2w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hwobDM0yrPDn35f1SraBpprm2Bu0KlDTG35cTqVNtHm+KJXQFUWWLhw1xnpe8P6Qq Q26vRKXArlnP3FAFO84EMQqDq7IEo3HDpivLeaW/K/Slyve0hfCvNrgloWuAWqFiCO H41Mwa29lGlXg0nd80uNjym8KghBmjLRuzIM6dY0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] git: don't break from event loop if cat-file fails Date: Fri, 24 May 2024 00:56:37 +0000 Message-ID: <20240524005638.3090446-2-e@80x24.org> In-Reply-To: <20240524005638.3090446-1-e@80x24.org> References: <20240524005638.3090446-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: `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 a9a821ad..ff38efa1 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