Background compiles give way to the lander: the Logbook statistics and the results refresher wait while [logbook] lander_lock is fresh (under 60 min); the statistics tools run below normal priority and a timeout ends the whole tree (an orphaned cl.exe went on compiling main at normal priority); a retried statistics run no longer relogs the same commits

This commit is contained in:
KeelrLeek committed 2026-10-09 10:46:40 -05:00
1 parent 21b7fedb6f
commit 56308e3aab
5 files changed
+154 -14

No files matched your search

+6 -9
View File
@@ -13,6 +13,7 @@ Configured per project in the [logbook] table (main is [logbook] decomp):
behaviour_every_hours = 12
behaviour_window = "01-06" from 01:00 to 06:00 local time; "" for any hour
No run starts while the lander runs its gates ([logbook] lander_lock, harbor.lander_gate).
One run at a time (the server runs one thread for every project), at the lowest process priority, into a .partial file
that replaces the results only once it is complete. The match run holds the same per-checkout lock as re_match_program,
so it waits its turn behind any other whole-program build of main.
@@ -31,7 +32,7 @@ import time
import traceback
from pathlib import Path
from . import logbook
from . import lander_gate, logbook
JOBS = ("match", "behaviour")
RESULTS_KEY = {"match": "match_results", "behaviour": "diffrun_results"}
@@ -180,14 +181,7 @@ def _spawn(argv, cwd, stdout, stderr):
def _kill_tree(pid):
if os.name == "nt":
subprocess.run(["taskkill", "/PID", str(pid), "/T", "/F"], capture_output=True,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0))
else:
try:
os.kill(pid, 9)
except OSError:
pass
lander_gate.kill_tree(pid)
def _alive(pid):
@@ -315,6 +309,9 @@ def tick(project, now=None, hour=None):
job, why = choose(settings(project), state, head, now, hour, requested, available)
if not job:
return {"idle": why, "head": head[:8]}
busy = lander_gate.lander_busy(project, now)
if busy: # a request is kept for the next look
return {"waiting": busy, "job": job}
if job == "match":
from .util import HarborError
try: