* [yocto-autobuilder-helper][PATCH] janitor/ab-janitor: attempt initial clones until success
@ 2025-05-22 18:38 Michael Halstead
0 siblings, 0 replies; only message in thread
From: Michael Halstead @ 2025-05-22 18:38 UTC (permalink / raw)
To: yocto, yocto-patches
Cc: mathieu.dubois-briand, richard.purdie, Michael Halstead
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-22 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 18:38 [yocto-autobuilder-helper][PATCH] janitor/ab-janitor: attempt initial clones until success Michael Halstead
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox