Skip to content

Use standard retry logic in _download_ranged - #938

Open
niukanen1 wants to merge 1 commit into
Open-EO:masterfrom
niukanen1:issue934-standard-retry
Open

niukanen1 wants to merge 1 commit into
Open-EO:masterfrom
niukanen1:issue934-standard-retry

Conversation

@niukanen1

Copy link
Copy Markdown

Fixes #934

Removes the hand-rolled per-range retry loop from _download_ranged. Transient failures are already retried by the urllib3 Retry configuration mounted on the connection's session, so the DIY loop only added divergent behavior: different retry counts, a different status-code set (408/500/501 retried here but not by the session), and OpenEoApiPlainError where the session raises RetryError

The unused MAX_DOWNLOAD_RETRIES_PER_RANGE / RETRIABLE_DOWNLOAD_STATUSCODES constants are gone

Tested with pytest tests/rest/test_download_ranged_retry.py tests/rest/test_job.py: 133 passed — including a new httpretty-based test proving a 503 on a range is retried by the session and the download completes

Remove the hand-rolled per-range retry loop (MAX_DOWNLOAD_RETRIES_PER_RANGE
+ RETRIABLE_DOWNLOAD_STATUSCODES) from _download_ranged. Transient
failures are already retried by the urllib3 Retry configuration mounted
on the connection's session (session_with_retries), so the DIY loop only
added divergent behavior: different retry counts, different status codes
(408/500/501 were retried here but not by the session), and
OpenEoApiPlainError raised where the session raises RetryError.

Fixes Open-EO#934
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.

Use standard retry logic in _download_ranged

1 participant