Skip to content

fix(merra2): retry granules that Cloud OPeNDAP transiently 404s - #25

Merged
jravani merged 1 commit into
enerplanetfrom
fix/merra2-retry-transient-404
Oct 6, 2026
Merged

jravani merged 1 commit into
enerplanetfrom
fix/merra2-retry-transient-404

Conversation

@jravani

@jravani jravani commented Oct 5, 2026

Copy link
Copy Markdown
Member

Summary

A full 1980-2025 MERRA-2 download lost 7 of 46 years to a single 404 each. Every one of those granules is listed in CMR under the exact name requested, and a rerun fetched each on the first attempt, so the 404s were transient. The downloader treated any 404 as "wrong stream", tried the fallback stream once and gave up on the year.

  • The stream candidates are now cycled three times, with a 2 s pause after each 404, before the granule is reported missing.
  • A granule genuinely published under the fallback stream still succeeds on its second request.

Testing

  • New test test_primary_stream_retried_after_transient_404 fails before the change with No MERRA-2 stream found for rad 2018-01-01 (tried streams (400, 401)) and passes after. test_gives_up_when_granule_never_appears covers the give-up path.
  • ruff check src/, mypy src: clean
  • pytest -q: 228 passed

A full 1980-2025 download lost 7 of 46 years to a single 404 each. Every
one of those granules is listed in CMR under the exact name requested,
and a rerun fetched each on the first attempt, so the 404s were
transient. The downloader treated any 404 as "wrong stream", tried the
fallback stream once and gave up on the year.

The stream candidates are now cycled three times, with a 2 s pause after
each 404, before the granule is reported missing. A granule genuinely
published under the fallback stream still succeeds on its second
request.
@jravani jravani added this to the v2.2.0 milestone Oct 5, 2026
@jravani
jravani merged commit 85b72c1 into enerplanet Oct 6, 2026
1 check passed
@jravani
jravani deleted the fix/merra2-retry-transient-404 branch October 6, 2026 21:27
@jravani jravani mentioned this pull request Oct 6, 2026
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.

1 participant