Skip to content

build: retry Cache@2 steps on task failure - #343325

Merged
Bryan Chen (bryanchen-d) merged 1 commit into
mainfrom
copilot/vscode/cache-restore-retry
Oct 22, 2026
Merged

Bryan Chen (bryanchen-d) merged 1 commit into
mainfrom
copilot/vscode/cache-restore-retry

Conversation

@bryanchen-d

Copy link
Copy Markdown
Collaborator

Adds retryCountOnTaskFailure: 2 to all 17 Cache@2 steps in the product build (build/azure-pipelines/**). Today a single transient pipeline-cache error fails the whole job, even though every restore except sccache already falls back to installing or downloading on a cache miss (cacheHitVar plus a conditional step).

Evidence (90 days, def 111, main and release/*)

About 25% of timelines couldn't be fetched, so treat these numbers as a floor.

Failure Builds Examples
Too Many Requests (429) from the pipeline cache service 8, including 2 post-job saves 467974, 486748, 486774, release builds 472035 and 486140
Blob download stuck in retries until Attempt timed out after 00:01:00 1 official insider 487166: Windows ARM64 Compile, Restore built-in extensions cache, about 15 min
Connection refused on :18080 in Restore WSL kernel installer cache 11, Oct 1–4 That step has since been removed (#342344), so this row is history only

Design notes

  • When retries run out, the build is still red. Cache@2 has no fail-open input; I checked the agent's PipelineCache plugin. The only way to fall through as a cache miss is continueOnError, which would turn routine cache hiccups into partially-succeeded builds. That's deliberately left out until there's data showing failures that survive both retries.
  • Post-job save: two of the 429s hit the post-job save, not the restore. Whether retryCountOnTaskFailure also applies to the post-job phase of a task isn't documented, so the validation run below is meant to answer that. I'll update this section with the result.
  • No step logic changes. Successful restores behave exactly as before.

Validation

  • All 17 edited YAML files parse.
  • Full def 111 run, Product mode, publish off: 487746 (t3i-cache-retry-validation). It exercises the node_modules, sccache, built-in extensions, sanity and quality-check caches on every platform. I'll report the result here.

Authored with Copilot

Copilot AI balanced review requested due to automatic review settings October 21, 2026 19:55

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
What changed in this PR

Improves build reliability by retrying Azure Pipelines Cache@2 tasks when transient cache-service failures occur (e.g., 429s), reducing job failures caused by temporary pipeline-cache errors.

Changes:

  • Adds retryCountOnTaskFailure: 2 to all Cache@2 restore steps across product build pipelines.
  • Keeps existing cache-hit / fallback behavior unchanged while making cache restores more resilient.
File Description
build/​azure-pipelines/​win32/​steps/​product-build-win32-test.yml Retries Cache@2 for WSL installer cache restore on task failure.
build/​azure-pipelines/​win32/​steps/​product-build-win32-setup.yml Retries Cache@2 for node_modules cache restore on task failure.
build/​azure-pipelines/​win32/​sdl-scan-win32.yml Retries Cache@2 for API Scan node_modules cache restore on task failure.
build/​azure-pipelines/​win32/​product-build-win32-node-modules.yml Retries Cache@2 for node_modules cache restore inside job.
build/​azure-pipelines/​web/​product-build-web.yml Retries Cache@2 for web node_modules cache restore inside job.
build/​azure-pipelines/​web/​product-build-web-node-modules.yml Retries Cache@2 for web node-modules job cache restore.
build/​azure-pipelines/​product-quality-checks.yml Retries Cache@2 for quality-checks node_modules cache restore.
build/​azure-pipelines/​linux/​steps/​product-build-linux-setup.yml Retries Cache@2 for linux node_modules cache restore on task failure.
build/​azure-pipelines/​linux/​product-build-linux-node-modules.yml Retries Cache@2 for linux node-modules job cache restore.
build/​azure-pipelines/​darwin/​steps/​product-build-darwin-setup.yml Retries Cache@2 for macOS node_modules cache restore on task failure.
build/​azure-pipelines/​darwin/​product-build-darwin-node-modules.yml Retries Cache@2 for macOS node-modules job cache restore.
build/​azure-pipelines/​copilot/​setup-steps.yml Retries Cache@2 for Copilot pipeline node_modules cache restore.
build/​azure-pipelines/​common/​sanity-tests.yml Retries Cache@2 for sanity tests node_modules cache restore.
build/​azure-pipelines/​common/​install-builtin-extensions.yml Retries Cache@2 for built-in extensions cache restore.
build/​azure-pipelines/​cli/​cli-compile.yml Retries Cache@2 for sccache restore on task failure.
build/​azure-pipelines/​alpine/​product-build-alpine.yml Retries Cache@2 for alpine node_modules cache restore.
build/​azure-pipelines/​alpine/​product-build-alpine-node-modules.yml Retries Cache@2 for alpine node-modules job cache restore.

Review effort: Lite

@bryanchen-d

Copy link
Copy Markdown
Collaborator Author

Validation run 487746 (Product mode, publish off) finished.

  • Cache steps: all 118 Cache@2 restore steps succeeded on every platform, and so did all 59 post-job saves. No step needed a retry, so the YAML expands and behaves the same as before on the success path.
  • Post-job retry: still unverified. No transient cache error happened during the run, so this run can't show whether retryCountOnTaskFailure also covers the post-job save. I'll update this if a later 429 shows it either way.
  • Red stages: the only failures are Unit Tests (Electron) on Linux x64, Windows x64 and macOS arm64. Each has the same 14 failures as main from feat(issueReporter): improve wizard destinations and attachments #342852 (issue reporter casing and WebM; see Issue reporter: WebM import and recording don't decode on the shipped Electron #343345). None of them are related to this change.

Co-authored with Copilot

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Base: 54d565d2 Current: 8ccfa08b

No screenshot changes.

@bryanchen-d
Bryan Chen (bryanchen-d) requested a balanced review from Copilot October 22, 2026 01:26

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open issue
2 resolved since last review

Review effort: Lite

None of the 17 Cache@2 steps in the product build retried, so one transient
pipeline-cache error failed the whole job even though every restore has a
miss fallback. Over 90 days of main and release builds:

- 8 builds failed on `Too Many Requests` (429) from the cache service,
  2 of them in the post-job save
- 487166 (official insider) lost Windows ARM64 Compile when the built-in
  extensions restore timed out after ~15 min of blob retries
- 11 builds hit connection refused in a WSL cache restore that has since
  been removed (#342344)

Add `retryCountOnTaskFailure: 2` to every Cache@2 step. A failure that
survives both retries still fails the job: Cache@2 has no fail-open input,
and `continueOnError` would turn the build partial.

Co-authored-by: Copilot <[email protected]>
@bryanchen-d
Bryan Chen (bryanchen-d) force-pushed the copilot/vscode/cache-restore-retry branch from 6d7acfd to 2e46e71 Compare October 22, 2026 20:22
@bryanchen-d
Bryan Chen (bryanchen-d) requested a balanced review from Copilot October 22, 2026 20:23

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

1 resolved since last review

Review effort: Lite

@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as ready for review October 22, 2026 21:41
@bryanchen-d
Bryan Chen (bryanchen-d) enabled auto-merge (squash) October 22, 2026 21:41
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ladislau Szomoru (@lszomoru)

Matched files:

  • build/azure-pipelines/alpine/product-build-alpine-node-modules.yml
  • build/azure-pipelines/alpine/product-build-alpine.yml
  • build/azure-pipelines/cli/cli-compile.yml
  • build/azure-pipelines/common/install-builtin-extensions.yml
  • build/azure-pipelines/common/sanity-tests.yml
  • build/azure-pipelines/copilot/setup-steps.yml
  • build/azure-pipelines/darwin/product-build-darwin-node-modules.yml
  • build/azure-pipelines/darwin/steps/product-build-darwin-setup.yml
  • build/azure-pipelines/linux/product-build-linux-node-modules.yml
  • build/azure-pipelines/linux/steps/product-build-linux-setup.yml
  • build/azure-pipelines/product-quality-checks.yml
  • build/azure-pipelines/web/product-build-web-node-modules.yml
  • build/azure-pipelines/web/product-build-web.yml
  • build/azure-pipelines/win32/product-build-win32-node-modules.yml
  • build/azure-pipelines/win32/sdl-scan-win32.yml
  • build/azure-pipelines/win32/steps/product-build-win32-setup.yml
  • build/azure-pipelines/win32/steps/product-build-win32-test.yml

Dmitriy Vasyura (@dmitrivMS)

Matched files:

  • build/azure-pipelines/common/sanity-tests.yml

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.

3 participants