You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2008/06/13 00:55:12 UTC

[jira] Updated: (MNG-3492) File.deleteOnExit not enough for embedder&CI

     [ http://jira.codehaus.org/browse/MNG-3492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-3492:
------------------------------

    Fix Version/s: 2.1-alpha-1

> File.deleteOnExit not enough for embedder&CI
> --------------------------------------------
>
>                 Key: MNG-3492
>                 URL: http://jira.codehaus.org/browse/MNG-3492
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0.7
>            Reporter: Kohsuke Kawaguchi
>             Fix For: 2.1-alpha-1
>
>
> When Maven is used in another long-running process (in this case Hudson), File.deleteOnExit() is not run early enough, so we end up accumulating insane amount of temporary files. DefaultWagonManager in particular does that a lot, even though (at least in some cases) the file could have been deleted explicitly.
> For example,  in the putRemoteFile method, the code reads as follows,
> {noformat}
>             // We do this in here so we can checksum the artifact metadata too, otherwise it could be metadata itself
>             for ( Iterator i = checksums.keySet().iterator(); i.hasNext(); )
>             {
>                 String extension = (String) i.next();
>                 // TODO: shouldn't need a file intermediatary - improve wagon to take a stream
>                 File temp = File.createTempFile( "maven-artifact", null );
>                 temp.deleteOnExit();
>                 FileUtils.fileWrite( temp.getAbsolutePath(), (String) sums.get( extension ) );
>                 wagon.put( temp, remotePath + "." + extension );
>             }
> {noformat}
> ... butI don't see why the temporary file cannot be deleted after the put method, or at least at the end of the method, after the Wagon component is released.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira