[
https://jira.codehaus.org/browse/MRM-1702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=311886#comment-311886
]
charles kim commented on MRM-1702:
----------------------------------
After looking at the patch again, patch seems to solve the concurrency issue
but synchronized on the filename intern does put a burden when requesting the
same artifact. May be some one else can provide more elegant solution.
> 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
> Attachments: ArchivaDavResource_patch.txt,
> DefaultRepositoryProxyConnectors_patch.txt
>
>
> 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