Repository navigation
fix(python): show and move top-level downloads left in staging after a restart - #826
Open
JAAdventurer wants to merge 2 commits into
Open
JAAdventurer wants to merge 2 commits into
JAAdventurer wants to merge 2 commits into
Conversation
…a restart pending_completion, which keeps the active scanner on a download in staging until it moves, is in memory only. After a restart the local scan (local_path only) couldn't see what was left in staging: a finished but unmoved download, recorded as downloaded with no local copy, showed as Deleted and was never moved; a stopped partial showed no size. Seed pending_completion from the pair's staging dir when its context is built (lftp's "<name>.lftp" temp file counts as <name>), and hand the names to the active scanner then so its first scan covers them, ahead of the first remote scan.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…sting _check_persist_authority read a missing remote size as "deleted remotely" and marked a persisted name with any local copy Downloaded. Before the first remote scan the size is only unknown. With downloads left in staging now visible right after a restart, a stopped top-level partial (persisted when its job ended) read as Downloaded in that window and was moved to local_path as if complete. Skip persist authority until the builder has had a remote listing.
This was referenced Nov 17, 2026
This branch has not been deployed
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.
Summary
With staging on, a top-level download left in staging is lost track of after a restart.
Why
pending_completion, which keeps the active scanner on it. That set lives in memory.local_path, so:downloaded_file_nameswith no local copy, so it shows as Deleted and is never moved.Fix
pending_completionis seeded from the top-level entries in that pair's staging dir. lftp's<name>.lftptemp file counts as<name>, and<name>.lftp-pget-statusis skipped.pending_completion.Persist authority waits for a remote listing (found in the live test)
_check_persist_authorityread a missing remote size as "deleted remotely", so a persisted name with any local copy was marked Downloaded.local_pathas if complete.ModelBuildernow skips persist authority until it has received a remote listing. Auto-queue only acts on rows with a remote size, so it's unaffected in that window.Skipped, and why
staged_nested) lives on feat: move nested downloads out of staging #824's branch, so their restart recovery is part of feat: move nested downloads out of staging #824.build_modelmuch more.Contract notes
setstream.test_build_state_persist_with_auto_delete_remotenow set an empty remote listing. Before, they set none, which no longer means "absent".Test plan
uv run ruff check .anduv run ruff format --check .uv run pyrightpytest tests/unittests: newTestStagedTopLevelNamesand wiring tests (pending_completionseeded, scanner handed the names, nothing with staging off) andtest_persist_authority_waits_for_a_remote_listingfail before their fixespytest tests/integration(onlytest_extractfails locally: no archive tools installed; CI covers it)