Skip to content

Direct URL wheels don't fall back on streaming extraction failures like registry wheels do #18620

Closed

Description

@themavik

Summary

In distribution_database.rs, get_wheel handles streaming failures differently depending on the source.

For BuiltDist::Registry (line ~240), the match catches Error::Extract and falls back to downloading the full wheel when streaming fails or is unsupported:

Err(Error::Extract(name, err)) => {
    if err.is_http_streaming_unsupported() {
        // fall back to download_wheel
    } else if err.is_http_streaming_failed() {
        // fall back to download_wheel
    } else {
        return Err(Error::Extract(name, err));
    }
    // ...download_wheel...
}

For BuiltDist::DirectUrl (line ~317), the match only catches Error::Client with is_http_streaming_unsupported():

Err(Error::Client(err)) if err.is_http_streaming_unsupported() => {
    // fall back to download_wheel
}

So if streaming extraction fails (not just unsupported) for a direct URL wheel, uv errors out instead of falling back to a full download. The registry path recovers from both cases.

Related: #5073, #17847 (streaming/download fallback area).

Platform

Linux x86_64 (code-level, platform-independent)

Version

latest main (code read from HEAD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions