[projects/pld-builder.new] src builder: accept BUILDING and UPLOADING from the binary builders
arekm
arekm at pld-linux.org
Thu Nov 12 00:29:56 CET 2026
commit e8ff23b149943ec389a0c6150320ea98a8e5e84b
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Nov 11 23:12:03 2026 +0100
src builder: accept BUILDING and UPLOADING from the binary builders
The queue showed "?" for a batch from the request until its whole
group was done on a builder, and any other status in a notification
was refused.
A notification may now carry BUILDING (the builder started the batch)
and UPLOADING (built, its files still to be sent). Neither is final,
so the request stays unfinished; queue.html shows them in orange. A
status never steps back: notifications are resent on failure, so an
older one can arrive after a newer one.
Update the src builder before the binary builders: an older one
refuses these statuses, and the binary builders keep resending them.
PLD_Builder/request.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py
index b78397a..c496ed9 100644
--- a/PLD_Builder/request.py
+++ b/PLD_Builder/request.py
@@ -63,10 +63,18 @@ def iso8601(ts, timezone='UTC'):
dt = datetime.fromtimestamp(ts, tz)
return dt.isoformat()
+# what a builder reports before a final status, in the order it goes through them: waiting,
+# building, built with its files still to be sent
+PROGRESS_STATUSES = ("?", "BUILDING", "UPLOADING")
+
def is_final(status):
"""Is a builder done with a batch: a status with a suffix, such as FAIL_DEPS_INSTALL, counts too"""
return status.startswith(("OK", "SKIP", "UNSUPP", "FAIL"))
+def status_rank(status):
+ """How far a status is on the way to a final one, which ranks highest"""
+ return PROGRESS_STATUSES.index(status) if status in PROGRESS_STATUSES else len(PROGRESS_STATUSES)
+
def is_blank(e):
return e.nodeType == Element.TEXT_NODE and e.nodeValue.strip() == ""
@@ -301,6 +309,8 @@ class Batch:
c = "blue"
elif s.startswith("UNSUPP"):
c = "fuchsia"
+ elif s != "?":
+ c = "darkorange"
else:
c = "black"
link_pre = ""
@@ -510,7 +520,7 @@ class Notification:
id = attr(c, "id")
status = attr(c, "status")
buildtime = attr(c, "buildtime", "0")
- if not is_final(status):
+ if not is_final(status) and status not in PROGRESS_STATUSES[1:]:
log.panic(f"xml notification: bad status: {status}")
self.batches[id] = status
self.batches_buildtime[id] = buildtime
@@ -521,7 +531,9 @@ class Notification:
for r in q.requests:
if r.kind == "group":
for b in r.batches:
- if b.b_id in self.batches:
+ # notifications are resent on failure, so an older one can come late
+ if b.b_id in self.batches and \
+ status_rank(self.batches[b.b_id]) >= status_rank(b.builders_status.get(self.builder, "?")):
b.builders_status[self.builder] = self.batches[b.b_id]
b.builders_status_time[self.builder] = time.time()
b.builders_status_buildtime[self.builder] = "0" #self.batches_buildtime[b.b_id]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/2cf988b75f72cba070da99d03d3c3e709f5166bc
More information about the pld-cvs-commit
mailing list