From: Michael Halstead <mhalstead@linuxfoundation.org>
To: yocto@lists.yoctoproject.org, yocto-patches@lists.yoctoproject.org
Cc: mathieu.dubois-briand@bootlin.com,
richard.purdie@linuxfoundation.org,
Michael Halstead <mhalstead@linuxfoundation.org>
Subject: [yocto-autobuilder-helper][PATCH] janitor/ab-janitor: attempt initial clones until success
Date: Thu, 22 May 2025 11:38:25 -0700 [thread overview]
Message-ID: <20250522183825.15315-1-mhalstead@linuxfoundation.org> (raw)
If the git clone operations don't succeed the mirror_processor thread
will spin updating nothing and index builds will fail. Instead the
thread will attempt the clones as many times as needed logging each
failure.
These are bare mirrors so look for the refs dir instead of .git.
Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
---
janitor/ab-janitor | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/janitor/ab-janitor b/janitor/ab-janitor
index bb58390..57749d6 100755
--- a/janitor/ab-janitor
+++ b/janitor/ab-janitor
@@ -65,8 +65,12 @@ def mirror_processor(mirrordir):
mirror = ourconfig["repo-defaults"][repo]["url"]
mirrorpath = os.path.join(mirrordir, repo)
mirrorpaths.append(mirrorpath)
- if not os.path.exists(mirrorpaths[-1] + "/.git/"):
- os.system("git clone --bare --mirror %s %s" % (mirror, mirrorpaths[-1]))
+ while not os.path.exists(mirrorpath + "/refs"):
+ exit_code = os.system("git clone --bare --mirror %s %s" % (mirror, mirrorpath))
+ if exit_code == 0:
+ break
+ print("Failed to clone %s. Retrying in 30 seconds..." % mirror)
+ time.sleep(30)
while True:
for path in mirrorpaths:
os.chdir(path)
--
2.49.0
reply other threads:[~2025-05-22 18:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250522183825.15315-1-mhalstead@linuxfoundation.org \
--to=mhalstead@linuxfoundation.org \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=richard.purdie@linuxfoundation.org \
--cc=yocto-patches@lists.yoctoproject.org \
--cc=yocto@lists.yoctoproject.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox