Uploaded image for project: 'Maven Build Cache Extension'
  1. Maven Build Cache Extension
  2. MBUILDCACHE-79

MBUILDCACHE-67 broke the partial restore process

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • remote build cache
    • 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).

      Attachments

        Activity

          People

            olamy Olivier Lamy
            hermes Amir Hadadi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: