Skip to content

should_retry() retries permanent I/O errors, causing infinite retry loops #2316

@ritankarsaha

Description

@ritankarsaha

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

ExtractError::should_retry() in crates/rattler_package_streaming/src/lib.rs returns true for all IoError and CouldNotCreateDestination variants, regardless of the underlying error kind. This means permanent, non-recoverable failures like PermissionDenied, NotFound, InvalidInput, and disk-full errors are incorrectly treated as transient and will be retried indefinitely.

Affected variants:

  ExtractError::IoError(_) => true,                    // retries PermissionDenied, NotFound 
  etc.                                                                                        
  ExtractError::CouldNotCreateDestination(_) => true,  // same problem

Expected behavior: Only genuinely transient network-related error kinds should trigger a retry:

  • BrokenPipe, ConnectionReset, ConnectionAborted, ConnectionRefused
  • NotConnected, TimedOut, UnexpectedEof, Interrupted

Permanent errors that must not retry:

  • PermissionDenied — retrying won't fix a permissions problem
  • NotFound — the file/path doesn't exist; retrying won't create it
  • InvalidInput / InvalidData — malformed data; retrying returns the same data
  • Others include catch-all, unknown, should not be assumed transient

Impact: Any caller that uses should_retry() to drive retry logic (e.g. in pixi's download/cache layer) will spin on permanent failures, wasting resources and hanging indefinitely instead of surfacing a clear error to the user.

@baszalmstra

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions