nas-burnin/app/burnin
Brandon Walter 7e42464016
Some checks are pending
Security scan / pip-audit (push) Waiting to run
Security scan / bandit (push) Waiting to run
Security scan / gitleaks (push) Waiting to run
Security scan / mypy (push) Waiting to run
fix: missing nonlocal on _drain's tracker vars (1.0.0-59)
After the chunk-read refactor, the inner _drain coroutine assigns
to last_db_write_ts and last_pct_sample. Without nonlocal, Python
compiles these as locals of _drain, so any READ before the first
assignment raises UnboundLocalError.

In 1.0.0-55 / -57 the bug was hidden by gather(return_exceptions=
True), which silently swallowed the exception — the drain coroutine
ended immediately, the asyncssh channel buffer filled up, and the
remote badblocks blocked on pipe_write. THAT was the actual cause
of the "parser silently never works" symptom, not anything to do
with the chunk-read or tr-pipe logic itself.

1.0.0-57 dropped the gather (single drain after merging 2>&1), which
made the next deploy surface the bug as an explicit error_text on
the surface_validate stage: "cannot access local variable
'last_db_write_ts' where it is not associated with a value".

Fix: add both vars to the nonlocal declaration. pending_log_chunks
only gets .append/.clear (no reassignment) so it doesn't need
nonlocal.

This is the bug that's been hiding behind all the recent parser
work. Sorry for the round trips.
2026-05-13 10:31:35 -07:00
..
__init__.py fix: cancel-mid-stage marks job 'unknown' not 'failed' (1.0.0-51) 2026-05-09 12:32:46 -07:00
_common.py feat: phase caption + bad-block badge + per-pattern history (1.0.0-47) 2026-05-08 23:23:02 -07:00
kill.py refactor: split burnin.py into a package — extract unlock + kill (1.0.0-30) 2026-05-03 00:44:28 -04:00
stages.py fix: missing nonlocal on _drain's tracker vars (1.0.0-59) 2026-05-13 10:31:35 -07:00
unlock.py refactor: split burnin.py into a package — extract unlock + kill (1.0.0-30) 2026-05-03 00:44:28 -04:00