Repository navigation
fix(github-backup): drain_queue loads plan/state through the shared validators (#6835) - #7002
Merged
Merged
Conversation
…alidators (#6835) drain_queue.main read plan.json/state.json with bare json.load — the one consumer bypassing ghb_common load_plan/load_state (#6637), so a wrong-shape entry crashed every 5-minute drain tick (string/int plan entries, dict plan, list state, string/dict drain_last, int/string drain_fail). Load both through the shared validators with report_problems, exactly like fetch_mirrors/clone_all/manifest: poison entries are named on stderr and skipped/reset, valid repos still drain, state.json is rewritten clean. Regression tests in test_drain_queue.py cover every probed shape against the real drain_queue.main plus the valid controls; the full github-backup suite is green (test_drain_queue 110/110).
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 8, 2026 00:49
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6835. Queue task 11054 (lane code-f).
drain_queue.mainwas the one github-backup consumer still reading plan.json/state.json with barejson.load, bypassing the #6637 shared gates — a single wrong-shape entry (string/int plan entry, dict plan, list state, string/dictdrain_last::*, int/stringdrain_fail::*) crashed every 5-minute drain tick before any event was fetched, acked, or logged.Change
infra/github-backup/bin/drain_queue.py: load state viaghb_common.load_state(root)and plan viaghb_common.load_plan(root), withreport_problems— the exact patternfetch_mirrors/clone_all/manifestalready use. Poison entries are named on stderr and skipped/reset; the valid planned repos still drain; state.json is rewritten clean at the end of the run; the DRAIN-CHRONIC path is untouched for genuine repeated failures.Tests (oracle: the issue's probed crash shapes, driven against the real
drain_queue.main)New cases 20–24 in
infra/github-backup/tests/test_drain_queue.py:drain_last::*→ dropped, coalesce window not applied, stamp rewritten numericdrain_fail::*→ dropped, failure count starts fresh, event stays queuedFull github-backup suite green on the laptop: test_drain_queue 110/110, plus clone_all, deploy, fetch_mirrors, inventory, plan/state shape, and reconcile suites all passing.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.