Skip to content

Reject entry reuse after cancelled unpack#93

Draft
zaniebot wants to merge 1 commit into
astral-sh:mainfrom
zaniebot:zb/cancel-safe-entry-unpack
Draft

Reject entry reuse after cancelled unpack#93
zaniebot wants to merge 1 commit into
astral-sh:mainfrom
zaniebot:zb/cancel-safe-entry-unpack

Conversation

@zaniebot

Copy link
Copy Markdown

Summary

  • mark an entry unusable when an in-progress unpack future is dropped
  • reject subsequent unpack and body-read attempts with an explicit error
  • preserve ordinary completed success and error behavior

Why

Regular-file unpacking drains the entry's data queue into the unpack future. If that future is cancelled after consuming data, retrying the same entry can previously succeed while writing an empty or truncated file. The consumed archive data cannot be rolled back, so explicit poisoning prevents a plausible but incorrect retry.

Testing

  • added a regression test that cancels after entry data is consumed and verifies that unpack and read retries fail explicitly
  • cargo check --all --all-targets --all-features
  • cargo test
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

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.

2 participants