[ 
https://issues.apache.org/jira/browse/SQOOP-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Lin updated SQOOP-3042:
----------------------------
    Attachment: SQOOP-3042.1.patch

Attaching the patch.

> Sqoop does not clear compile directory under /tmp/sqoop-<username>/compile 
> automatically
> ----------------------------------------------------------------------------------------
>
>                 Key: SQOOP-3042
>                 URL: https://issues.apache.org/jira/browse/SQOOP-3042
>             Project: Sqoop
>          Issue Type: Bug
>            Reporter: Eric Lin
>            Priority: Critical
>         Attachments: SQOOP-3042.1.patch
>
>
> After running sqoop, all the temp files generated by ClassWriter are left 
> behind on disk, so anyone can check those JAVA files to see the schema of 
> those tables that Sqoop has been interacting with. By default, the directory 
> is under /tmp/sqoop-<username>/compile.
> In class org.apache.sqoop.SqoopOptions, function getNonceJarDir(), I can see 
> that we did add "deleteOnExit" on the temp dir:
> {code}
>     for (int attempts = 0; attempts < MAX_DIR_CREATE_ATTEMPTS; attempts++) {
>       hashDir = new File(baseDir, RandomHash.generateMD5String());
>       while (hashDir.exists()) {
>         hashDir = new File(baseDir, RandomHash.generateMD5String());
>       }
>       if (hashDir.mkdirs()) {
>         // We created the directory. Use it.
>         // If this directory is not actually filled with files, delete it
>         // when the JVM quits.
>         hashDir.deleteOnExit();
>         break;
>       }
>     }
> {code}
> However, I believe it failed to delete due to directory is not empty.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to