Skip to content

fix(download): improve download_and_unzip error handling - #342

Merged
wpbonelli merged 1 commit into
MODFLOW-ORG:developfrom
wpbonelli:fix-download
Aug 11, 2026
Merged

fix(download): improve download_and_unzip error handling#342
wpbonelli merged 1 commit into
MODFLOW-ORG:developfrom
wpbonelli:fix-download

Conversation

@wpbonelli

Copy link
Copy Markdown
Member

The retry loop in download_and_unzip could hang if it encountered a persistently failing/stalling endpoint, either blocking forever on the read or retrying HTTPError indefinitely with no backoff.

  • Pass timeout (default 30s) to urlopen, mirroring fetch_url's existing timeout param
  • Catch URLError and ConnectionError in addition to HTTPError
  • Add an unconditional raise after exceeding the retry count, guaranteeing the loop terminates
  • Add an exponential backoff between retries

@wpbonelli wpbonelli added the bug Something isn't working label Aug 11, 2026
@wpbonelli
wpbonelli merged commit 19c7fc5 into MODFLOW-ORG:develop Aug 11, 2026
14 checks passed
@wpbonelli
wpbonelli deleted the fix-download branch August 11, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant