Skip to content

fix: retry transient schema request failures - #1290

Merged
datho7561 merged 1 commit into
redhat-developer:mainfrom
h55n:fix/retry-transient-schema-requests
Oct 2, 2026
Merged

datho7561 merged 1 commit into
redhat-developer:mainfrom
h55n:fix/retry-transient-schema-requests

Conversation

@h55n

@h55n h55n commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Retries remote schema requests that fail for a temporary reason, instead of treating the first failure as final. This is the client side of redhat-developer/yaml-language-server#1342: the extension fetches schemas through its own request path, so the language server change does not reach it.

Retried: HTTP 429, 502, 503, 504, and connection errors. Everything else, including 304, 403 and 404, fails immediately as before. Retry-After is honoured, otherwise exponential backoff with jitter. Each wait is capped at 1s and there are at most 2 retries, so schema loading cannot stall editing for long. The final error is rethrown unchanged.

Fixes #1284

16 unit tests cover error classification, Retry-After parsing, delay capping, retry budget and no-retry cases. The logic lives in a module with no vscode import so it runs without the extension host. Lint, type check and webpack build pass. I did not run the full vscode-test suite locally.

Retries remote schema requests that fail with 429, 502, 503 or 504, or with a connection reset or timeout, at most twice, honouring Retry-After and capping the wait at one second. Other failures, including 304 and 404, are not retried. Mirrors yaml-language-server#1342 for the client's own request path.
@h55n
h55n requested a review from datho7561 as a code owner October 2, 2026 13:22
Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@datho7561 datho7561 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.

Verified it reattempts to load the schema by running a local test express server that rejects the first few times.

Thanks, @h55n !

@datho7561
datho7561 merged commit f4ac9f5 into redhat-developer:main Oct 2, 2026
5 checks passed
@h55n

h55n commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for testing it by hand and for the quick merge, @datho7561.

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.

Migrate "retry after delay" from yaml-language-server to vscode-yaml

3 participants