Conversation
…02 errors The WorldBank type provider makes live HTTP requests at compile time to populate the country/indicator/region/topic types. Previously, retries happened immediately with no delay, meaning all 5 retries would fail in rapid succession during transient server-side outages (e.g. 502 Bad Gateway). Add a 2-second delay between retries so that brief API outages are more likely to be survived before all retries are exhausted. Fixes #1748 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Root Cause (Issue #1748)
The CI failure is not related to the FSharp.TypeProviders.SDK update. The actual error (visible in the build log) is:
The WorldBank type provider makes live HTTP requests at compile time to populate the
Countries,Indicators,Regions, andTopicsprovided types. When the WorldBank API was temporarily returning 502, the type provider threw an exception that became a compiler error (FS3021), causing the test project to fail to build.The Fix
Previously, retries on failure happened immediately with no delay between attempts. This means all 5 retries would fail in rapid succession during a transient server-side outage (e.g. 502 Bad Gateway), exhausting all retries within milliseconds.
This PR adds a 2-second delay (
retryDelayMs = 2000) between retries, so the total retry window is ~10 seconds. This gives the WorldBank API time to recover from brief load spikes or gateway errors before all retries are exhausted.Changes
src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs: AddAsync.Sleep retryDelayMsbefore each retry inworldBankRequestTrade-offs
Note: A more comprehensive fix would pre-seed the WorldBank schema cache with static fixture data, so the type provider never needs to make network requests in CI. That would be a larger change and could be done as a follow-up.
Test Status
FSharp.Data.WorldBank.Corebuilds successfullyFSharp.Data.Testsproject (which contains the WorldBank integration tests) requires live WorldBank API access — it cannot be validated in this environment without network access toapi.worldbank.orgCloses #1748