Skip to content

refactor(project): Reset result cache state on source-changed retry#1402

Merged
matz3 merged 1 commit into
mainfrom
fix-no_cache-error
Jun 2, 2026
Merged

refactor(project): Reset result cache state on source-changed retry#1402
matz3 merged 1 commit into
mainfrom
fix-no_cache-error

Conversation

@matz3
Copy link
Copy Markdown
Member

@matz3 matz3 commented Jun 1, 2026

allTasksCompleted reset the index state when throwing SourceChangedDuringBuildError but left resultCacheState untouched. Because BuildServer reuses the same ProjectBuildCache instance across retries, a prior prepareProjectBuildAndValidateCache that had transitioned the field to NO_CACHE or FRESH_AND_IN_USE caused the retry to trip the PENDING_VALIDATION invariant in the
RESTORING_DEPENDENCY_INDICES branch and fail with
"Unexpected result cache state after restoring dependency indices for project XYZ: no_cache".

allTasksCompleted reset the index state when throwing
SourceChangedDuringBuildError but left resultCacheState untouched.
Because BuildServer reuses the same ProjectBuildCache instance across
retries, a prior prepareProjectBuildAndValidateCache that had
transitioned the field to NO_CACHE or FRESH_AND_IN_USE caused the retry
to trip the PENDING_VALIDATION invariant in the
RESTORING_DEPENDENCY_INDICES branch and fail with
"Unexpected result cache state after restoring dependency indices for
project XYZ: no_cache".
@matz3 matz3 requested a review from a team June 1, 2026 14:20
@matz3 matz3 merged commit 1470d66 into main Jun 2, 2026
94 of 95 checks passed
@matz3 matz3 deleted the fix-no_cache-error branch June 2, 2026 13:52
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