jenkinsci / fabric-beta-publisher-plugin

DEPRECATED: A Jenkins plugin that lets you publish Android apps to Fabric Beta
MIT License
24 stars 17 forks source link

/tmp space disk leak - temporary directory not removed after upload #46

Open chrismcx opened 5 years ago

chrismcx commented 5 years ago

Hi,

I've found an issue on Fabric beta publisher plugin. On FileUtils.java, Fabric plugin extracts the Crashlytics zip into a temporary folder (method extractCrashlyticsJar). However, this temporary folder is never deleted. So at least, our /tmp partition is full and we have to manually delete all temporary folders created.

We cannot easily fix this issue because the "crashlyticsJar" variable is not returned by the extractCrashlyticsJar method.

Can you fix this ?

The code in error


 static File extractCrashlyticsJar(File crashlyticsZip, PrintStream logger) throws IOException {
        File crashlyticsJar = createTempDirectory(); // **NEVER DELETED**
        unzip(crashlyticsZip.getAbsolutePath(), crashlyticsJar);
        File crashlyticsZipFile = new File(crashlyticsJar, "crashlytics-devtools.jar");

        delete(logger, crashlyticsZip);
        return crashlyticsZipFile;
    }
khurdz commented 5 years ago

👍

egor-n commented 5 years ago

The Crashlytics zip file contains a single JAR file which is returned in this method. Then, it is deleted in the FabricBetaPublisher#publishFabric method at the end.