From 1393ba0bc8ecf1fdbd8ae015958d4f1d6a0ce221 Mon Sep 17 00:00:00 2001 From: Brandon Walter <51866976+echoparkbaby@users.noreply.github.com> Date: Fri, 8 May 2026 22:45:45 -0700 Subject: [PATCH] fix: seed bb_phase=1,pct=0 at surface_validate start (1.0.0-45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the parser only wrote bb_phase to the DB when state *changed* — so for the first several minutes of a 14 TB burn-in (before badblocks emits its first 'X% done' line), bb_phase stayed NULL and the drawer's per-pattern meters didn't render at all. Looked broken to operators. Now we write phase=1, phase_pct=0 immediately on stage entry. The parser keeps overwriting on every subsequent tick. Drawer shows empty meters with 0xaa label highlighted blue from t=0. --- app/burnin/stages.py | 11 +++++++++++ app/config.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/burnin/stages.py b/app/burnin/stages.py index dd4b991..a342762 100644 --- a/app/burnin/stages.py +++ b/app/burnin/stages.py @@ -495,6 +495,17 @@ async def _stage_surface_validate_ssh(job_id: int, devname: str, drive_id: int) pid_seen = False progress = _BadblocksProgress() + # Seed bb_phase=1, bb_phase_pct=0 immediately so the + # drawer's per-pattern meters have something to render + # before badblocks emits its first "X% done" line. On a + # 14 TB drive that first line can be several minutes in, + # and a blank meter strip looks broken to the operator. + await _update_stage_bb_phase( + job_id, "surface_validate", + progress.phase, progress.phase_pct, + ) + _push_update() + async def _drain(stream, is_stderr: bool): nonlocal bad_blocks_total, pid_seen async for raw in stream: diff --git a/app/config.py b/app/config.py index 370efc5..fd95468 100644 --- a/app/config.py +++ b/app/config.py @@ -86,7 +86,7 @@ class Settings(BaseSettings): ssh_key: str = "" # PEM private key content (paste full key including headers) # Application version — used by the /api/v1/updates/check endpoint - app_version: str = "1.0.0-44" + app_version: str = "1.0.0-45" # ---- Authentication (1.0.0-22) ---- # session_secret: HMAC key for signing session cookies. Empty = generate