[ 
https://issues.apache.org/jira/browse/MBUILDCACHE-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17830842#comment-17830842
 ] 

ASF GitHub Bot commented on MBUILDCACHE-71:
-------------------------------------------

amirhadadi opened a new pull request, #138:
URL: https://github.com/apache/maven-build-cache-extension/pull/138

   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.
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [X] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)




> buildinfo.xml should be stored after storing the project's artifacts
> --------------------------------------------------------------------
>
>                 Key: MBUILDCACHE-71
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-71
>             Project: Maven Build Cache Extension
>          Issue Type: Improvement
>    Affects Versions: 1.0.1
>            Reporter: Amir Hadadi
>            Priority: Major
>
> In certain failure cases it's possible that only part of a module artifacts 
> get stored in the local and remote storage. In that case if buildinfo.xml got 
> stored, the extension will later incorrectly attempt to restore the partially 
> cached build.
> Because buildinfo.xml is used as an indication that the cached artifacts 
> exist, I propose to reorder the logic in 
> {code:java}
> CacheControllerImpl.save(){code}
>  so that 
> {code:java}
> localCache.saveBuildInfo(cacheResult, build);{code}
> will happen after the project's artifacts are stored.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to