From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 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.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5EFCE1FAF0 for ; Mon, 12 Dec 2022 09:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1670839134; bh=H6t3bCcsCDznS+zuRlZ+1WGKI/vQIL6CJC1DJD9+sls=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wEQFjR0hQXQcuLHtA09vctPMOAA7Mbkwr36AxJ8GLii4ymv6W/EhvMF7aU6B9JhvV D+1eWb1nCdx7SW2I2QR2Pp16L76V9JuGC88zqHdbTpt/Xi4PaHi5Y/KUdfDQb2EohC Jkmu8MZKcu4FSR7ALMlYbuUNdaExZrMCQwUy2pyc= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] lei_mirror: break circular references Date: Mon, 12 Dec 2022 09:58:54 +0000 Message-Id: <20221212095854.17921-3-e@80x24.org> In-Reply-To: <20221212095854.17921-1-e@80x24.org> References: <20221212095854.17921-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It seems more graceful than dying and breaking a mirror, since the {reference} in util-linux was irrelevant anyways with the move to forkgroups. --- lib/PublicInbox/LeiMirror.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index d6d2c69e..92156cf1 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -960,9 +960,13 @@ sub clone_all { # resolve multi-level references while ($m && defined($nxt = $m->{$x}->{reference})) { exists($todo->{$nxt}) or last; - die < 1000; -E: dependency loop detected (`$x' => `$nxt') + if (++$nr > 1000) { + $m->{$x}->{reference} = undef; + $m->{$nxt}->{reference} = undef; + warn < `$nxt'), breaking EOM + } $x = $nxt; } my $y = delete $todo->{$x} // next; # already done