#51881: build: profile-pure PGO collection retries + automatic state-file update PRs
Merged
Created: Jun 4, 2026, 2:41:35 PM
Merged: Jun 4, 2026, 11:33:43 PM
3 comments
Target: main
Two improvements to the PGO generation pipeline, prompted by run 26933006860 where a jetstream2 startability failure on win-x86 could never be retried and blocked publishing.
Profile-pure collection retries
The in-app retry from #51866 left the failed attempt's counters in the profile (continuous-mode counters are app-lifetime cumulative and cannot be excised). Replaced with wipe-and-relaunch retries in collect-profile.js:
- up to
--attempts(default 5) full relaunches, each starting from an empty profraw dir and fresh processes, so a published profile only ever contains counters from one fully-successful run - non-final attempts abort on the first workload failure (
PGO_ABORT_ON_FAILURE); the final attempt runs to completion so a persistent failure still uploads a maximal partial profile - retries stop launching past
--retry-deadline-minutes(default 240) so the in-flight attempt finishes and flushes counters before the step timeout (a hard kill loses the exit-time profraw write); step timeout raised 150 → 330 to match - jetstream2 fails in seconds instead of polling its 300s startability window when the driver flags a load error (
startFailExpronallIsGood), which is exactly the failure from the run above
Publish gate + automatic state-file PR
upload-profilesnow requires every build/collect/merge job to be green (skipped platforms via theskip-*inputs remain allowed) - a partial profile set never reaches the CDN or the state files- after the Azure upload, the job exchanges its OIDC token for an
electron-pgo-updaterapp token viaelectron/secret-service-action(electron/secret-service#69) and opens a PR updatingbuild/pgo_profiles/*.pgo.txtto the freshly uploaded profiles - the app token is restricted to
single_file: writeon the nine state files and cannot create refs, soGITHUB_TOKENcreates thepgo/update/*branch and the app token commits each state file via the contents API (verified against the live installation)
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron