fix(dvcr): importer#2511
Draft
universal-itengineer wants to merge 3 commits into
Draft
Conversation
Wire sourceImageSize through inspectAndStreamSourceImage into getImageInfo. The parameter will be used in a follow-up commit to skip the redundant full-stream drain for raw/iso/qcow2 formats. Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
…/iso/raw Previously getImageInfoStandard always drained the entire source stream into io.Discard after running qemu-img info on the first 64 MiB. Combined with the blocking io.TeeReader in inspectAndStreamSourceImage, that throttled the main DVCR upload to ~4 MB/s on large (~5 GB) Windows images. The drain is redundant for plain (non-archived) inputs: - qcow2: VirtualSize is already populated by qemu-img info from the 64 MiB temp file; - iso/raw: virtual size equals the on-wire source size (sourceImageSize). Drain is preserved for archived formats (gz/xz/zst) where the uncompressed size must still be computed from the stream. Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Replace io.TeeReader in inspectAndStreamSourceImage with a small non-blocking variant. Once the inspect side finishes and closes its end of the pipe, the writer is marked done and subsequent reads bypass it entirely, so a slow or closed inspect consumer can no longer back-pressure the main upload stream. The Write error from the inspect side is intentionally swallowed: the inspect pipe is best-effort and must never fail the upload. Together with the previous commit that removes the redundant full-stream drain, this restores DVCR import throughput to network speed for large qcow2/iso/raw images. Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
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.
Description
Why do we need it, and what problem does it solve?
What is the expected result?
Checklist
Changelog entries