[ https://issues.apache.org/jira/browse/MBUILDCACHE-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17812029#comment-17812029 ]
Igor Dianov edited comment on MBUILDCACHE-79 at 1/29/24 7:12 PM: ----------------------------------------------------------------- This problem already existed in 1.1.0 release after MBUILDCACHE-67 was merged. There is a fix for this issue I submitted in MBUILDCACHE-80 and a PR with the fix waiting for review in [https://github.com/apache/maven-build-cache-extension/pull/128] was (Author: JIRAUSER303977): This problem already existed in 1.1.0 release before MBUILDCACHE-67 was merged. There is a fix for this issue I submitted in MBUILDCACHE-80 and a PR with the fix waiting for review in https://github.com/apache/maven-build-cache-extension/pull/128 > MBUILDCACHE-67 broke the partial restore process > ------------------------------------------------ > > Key: MBUILDCACHE-79 > URL: https://issues.apache.org/jira/browse/MBUILDCACHE-79 > Project: Maven Build Cache Extension > Issue Type: Bug > Components: remote build cache > Affects Versions: 1.1.0 > Reporter: Amir Hadadi > Priority: Critical > > 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: > > {code:java} > 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) {{code} > to: > > {code:java} > 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) { > ...{code} > > Since partially restored builds have > {code:java} > restored == false{code} > The > {code:java} > if (!restored){code} > block is always executed, rerunning all the plugins (including the restored > ones). -- This message was sent by Atlassian Jira (v8.20.10#820010)