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, T_SCC_BODY_TEXT_LINE 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 0BD631F513 for ; Tue, 9 Jan 2024 11:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1704800369; bh=jbEfEqSBxt0MOMW5hnDtJxKKhohcCUkkmYOWO9asdmA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nGBeAuOAtWQGuuWTcH267MIRjTDdc6bY3QaLhhkulAXDfoMh5+mOcZpxcLq1e6kgI 746bqGwXYyAOF1yIx2DnVgYdme25gql40EH37+CPSDoB486nYYG+QPU2C/v+j3Vo9l v/eykTaXS7HYy93/d5RB7y4Vghz74RrEqfubGj5U= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/6] git: workaround occasional -watch error message Date: Tue, 9 Jan 2024 11:39:23 +0000 Message-Id: <20240109113928.992464-2-e@80x24.org> In-Reply-To: <20240109113928.992464-1-e@80x24.org> References: <20240109113928.992464-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I'm not sure how this happens (perl 5.34.1 on FreeBSD 13.2) but it appears the {sock} check can succeed and then go undef and become unable to call ->owner_pid. This happens when libgit2 is in use, so perhaps that's a factor. In any case, the rest of the tests succeed. --- lib/PublicInbox/Git.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 6c4fcf93..7b991c6b 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -208,8 +208,17 @@ sub cat_async_retry ($$) { sub gcf_inflight ($) { my ($self) = @_; + # FIXME: the first {sock} check can succeed but Perl can complain + # about calling ->owner_pid on an undefined value. Not sure why or + # how this happens but t/imapd.t can complain about it, sometimes. if ($self->{sock}) { - return $self->{inflight} if $self->{sock}->owner_pid == $$; + if (eval { $self->{sock}->owner_pid == $$ }) { + return $self->{inflight}; + } elsif ($@) { + no warnings 'uninitialized'; + warn "E: $self sock=$self->{sock}: owner_pid failed: ". + "$@ (continuing...)"; + } delete @$self{qw(sock inflight)}; } else { $self->close;