Skip to content

Reduce primary-provider retry budget to 3 attempts total - #975

Merged
louis-e merged 1 commit into
mainfrom
fix/reduce-retry-budget
Apr 23, 2026
Merged

louis-e merged 1 commit into
mainfrom
fix/reduce-retry-budget

Conversation

@louis-e

@louis-e louis-e commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Logs on a 272-tile USGS 3DEP run (#971 follow-up) showed the 5-attempt ladder taking ~12 s per tile across three tiles before giving up — feels excessive when the AWS Terrarium fallback is ~2 s away and produces perfectly usable output. Trim to 3 attempts total (initial + 2 retries) so we spend at most ~2.25 s plus jitter on a flaky tile before handing it off.

The fallback path already handles persistent upstream failures well: visually-verified recovery on the 1/272 case reported from the field shows no seams or holes in the generated world.

Logs on a 272-tile USGS 3DEP run (#971 follow-up) showed the 5-attempt
ladder taking ~12 s per tile across three tiles before giving up —
feels excessive when the AWS Terrarium fallback is ~2 s away and
produces perfectly usable output. Trim to 3 attempts total (initial +
2 retries) so we spend at most ~2.25 s plus jitter on a flaky tile
before handing it off.

The fallback path already handles persistent upstream failures well:
visually-verified recovery on the 1/272 case reported from the field
shows no seams or holes in the generated world.
Copilot AI review requested due to automatic review settings April 23, 2026 19:27
@louis-e
louis-e merged commit bbd3bac into main Apr 23, 2026
4 checks passed
@louis-e
louis-e deleted the fix/reduce-retry-budget branch April 23, 2026 19:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces the retry/backoff budget for primary fixed-tile elevation providers (notably USGS 3DEP) so persistent/transient upstream failures fall back to AWS Terrarium sooner, improving end-to-end generation latency on flaky tiles.

Changes:

  • Reduced the maximum request attempt budget from 5 total attempts to 3 total attempts.
  • Updated the accompanying inline documentation to reflect the new attempt/backoff budget and rationale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// fallback in `fetch_fixed_tile_grid`, which is cheap enough that we
/// prefer getting there quickly over retrying the primary provider
/// for longer.
const MAX_RETRIES: u32 = 3;

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAX_RETRIES now represents the total number of attempts (initial + retries), as indicated by the updated doc comment and the for attempt in 0..MAX_RETRIES loop semantics. The name is misleading and makes it easy to accidentally re-tune the budget incorrectly later; consider renaming to something like MAX_ATTEMPTS/MAX_TOTAL_ATTEMPTS and updating its call sites/log output accordingly.

Suggested change
const MAX_RETRIES: u32 = 3;
const MAX_ATTEMPTS: u32 = 3;

Copilot uses AI. Check for mistakes.
@github-actions

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 59s
🏗️ Generation time: 27s (excl. data fetching)
🧠 Peak memory usage: 1946 MB

📈 Compared against baseline: 30s
🧮 Delta: 29s
🔢 Commit: 0f8ff1c

🟢 Generation time is unchanged.

📅 Last benchmark: 2026-04-23 19:29:35 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

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.

2 participants