Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.1.0
-
None
Description
In MBUILDCACHE-67 a bug was introduced in BuildCacheMojosExecutionStrategy#execute. Due to the bug, after a partial restore from cache all executions that were restored are executed for the second time.
The bug was introduced by changing:
boolean restorable = result.isSuccess() || result.isPartialSuccess(); boolean restored = result.isSuccess(); // if partially restored need to save increment if (restorable) { restored &= restoreProject(result, mojoExecutions, mojoExecutionRunner, cacheConfig); } else { for (MojoExecution mojoExecution : mojoExecutions) {
to:
boolean restorable = result.isSuccess() || result.isPartialSuccess(); boolean restored = result.isSuccess(); // if partially restored need to save increment if (restorable) { CacheRestorationStatus cacheRestorationStatus = restoreProject(result, mojoExecutions, mojoExecutionRunner, cacheConfig); restored &= CacheRestorationStatus.SUCCESS == cacheRestorationStatus; executeExtraCleanPhaseIfNeeded(cacheRestorationStatus, cleanPhase, mojoExecutionRunner); } if (!restored) { ...
Since partially restored builds have
restored == false
The
if (!restored)
block is always executed, rerunning all the plugins (including the restored ones).