Skip to content

Fix stalled image pull cancellation - #421

Open
jacklipper24-byte wants to merge 1 commit into
libracoder:mainfrom
jacklipper24-byte:jacklipper24-byte-curly-sniffle
Open

jacklipper24-byte wants to merge 1 commit into
libracoder:mainfrom
jacklipper24-byte:jacklipper24-byte-curly-sniffle

Conversation

@jacklipper24-byte

Copy link
Copy Markdown

What this changes and why

Make cancellation responsive while an image pull is waiting on a registry read. In particular, Windows does not reliably interrupt a blocking TcpStream read when another thread shuts down the socket, so pull-scoped reads now poll and check cancellation without shortening the normal stall timeout.

Fixes: N/A

How you tested it

cargo test -p kiri-image --lib -- --test-threads=1: passed (43 passed, 0 failed)
cargo clippy -p kiri-image --all-targets --quiet -- -D warnings: failed on 3 existing lints in registry.rs and archive.rs
cargo clippy -p kiri-image --all-targets --quiet -- -D warnings -A clippy::needless_borrows_for_generic_args -A clippy::cloned_ref_to_slice_refs: passed
git diff --check: passed
cargo fmt --check: failed on existing repository-wide formatting diffs

Tested on: Windows (version not recorded)

How you found it

  • I use Kiri and ran into this myself
  • I found it by reading the code or comparing with Docker
  • Someone else reported it (link the issue above)

AI tools used to write this change: yes; identified the Windows read-cancellation issue, implemented the polling fix, and ran the tests.

Checklist

  • I have at most 3 pull requests open on Kiri, this one included
  • cargo fmt, cargo clippy and the tests pass
  • It works on macOS, Windows and Linux, or the change only touches one of them

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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