Skip to content

fix(onnx): remove a failed stage even after cancellation or timeout - #3

Draft
autoantohaki wants to merge 1 commit into
mainfrom
fix/clean-staging-after-cancel
Draft

autoantohaki wants to merge 1 commit into
mainfrom
fix/clean-staging-after-cancel

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Requested by mau

Before: if ModelStore::install or ModelStore::import failed because it was cancelled or ran past its deadline, it tried to delete its .<bundle>.staging directory with the same token and deadline that had just expired. remove_safe checks that budget before doing anything, so the cleanup returned straight away and left the partial artifacts on disk until the next install or import.

After: a failed stage is always removed, whatever the reason for the failure.

How: a new discard_stage helper runs remove_safe with a fresh cancellation token and its own 30-second STAGE_CLEANUP_BUDGET. install and import both use it. A new test cancels an install partway through a slow download and checks that the staging directory is gone. Without the fix, this test fails.

Note: this PR changes .rs sources, so the Windows runtime qualification attestation has to be re-recorded before verify-runtime-qualification-attestation.ps1 passes.

install and import cleaned up their staging directory with the same
cancellation token and deadline that had just failed. remove_safe checks
that budget first, so a cancelled or timed-out operation skipped cleanup
and left partial artifacts in .<bundle>.staging until the next attempt.
Run the cleanup under its own token and a separate 30 second budget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant