Skip to content

Commit

Permalink
[MBUILDCACHE-71] Store the build info after storing the artifacts. (#138
Browse files Browse the repository at this point in the history
)

This is done for 2 reasons:
1) To prevent a race condition where build X is storing the build info and build Y is pulling that info and attempting to use the artifacts before build X stored them.

2) When a build is killed (for any reason) after the build info is stored but before the artifacts are stored, a later build will attempt to use the non-existing artifacts.

Co-authored-by: ahadadi <[email protected]>
  • Loading branch information
amirhadadi and ahadadi authored Mar 29, 2024
1 parent 56cf214 commit 35a53a9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ public void save(

// if package phase presence means new artifacts were packaged
if (project.hasLifecyclePhase("package")) {
localCache.saveBuildInfo(cacheResult, build);
if (projectArtifact.getFile() != null) {
localCache.saveArtifactFile(cacheResult, projectArtifact);
}
Expand All @@ -518,10 +517,10 @@ public void save(
}
}
}
} else {
localCache.saveBuildInfo(cacheResult, build);
}

localCache.saveBuildInfo(cacheResult, build);

if (cacheConfig.isBaselineDiffEnabled()) {
produceDiffReport(cacheResult, build);
}
Expand Down

0 comments on commit 35a53a9

Please sign in to comment.