user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/2] lei_mirror: break circular references
Date: Mon, 12 Dec 2022 09:58:54 +0000	[thread overview]
Message-ID: <20221212095854.17921-3-e@80x24.org> (raw)
In-Reply-To: <20221212095854.17921-1-e@80x24.org>

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 <<EOM if ++$nr > 1000;
-E: dependency loop detected (`$x' => `$nxt')
+				if (++$nr > 1000) {
+					$m->{$x}->{reference} = undef;
+					$m->{$nxt}->{reference} = undef;
+					warn <<EOM
+E: dependency loop detected (`$x' => `$nxt'), breaking
 EOM
+				}
 				$x = $nxt;
 			}
 			my $y = delete $todo->{$x} // next; # already done

      parent reply	other threads:[~2022-12-12  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  9:58 [PATCH 0/2] lei_mirror: minor tweaks and fixups Eric Wong
2022-12-12  9:58 ` [PATCH 1/2] lei_mirror: trim current symlinks from warning Eric Wong
2022-12-12  9:58 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221212095854.17921-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).