charles kim created MRM-1702:
--------------------------------

             Summary: Race condition caused by retrieving the same artifact 
from a Proxy from muliple threads
                 Key: MRM-1702
                 URL: https://jira.codehaus.org/browse/MRM-1702
             Project: Archiva
          Issue Type: Bug
    Affects Versions: 1.4-M1
         Environment: RHEL6
            Reporter: charles kim


When multiple requests are made for the same artifact where proxy is used 
(meaning there is no local file exists yet), there is a race condition.

A code block that moves the downloaded temp file to target location is in 
synchronized block which does prevent them from writing the same file, 

Before moving the temp file to the target location, it overwrites the existing 
file ( by first checking the file existence and removes it). 

By removing it (from the 2nd thread), the first thread that wrote the file and 
and tries to spool the file again throws  java.io.FileNotFoundException.

Please see attached patch.

Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to