Fix: race condition on shutdown of zip extractor

This commit is contained in:
Sheepit Renderfarm
2024-12-13 13:09:20 +01:00
committed by laurent
parent 912a07850f
commit 54b5a6ca6c

View File

@@ -245,6 +245,17 @@ public class UnzipUtils {
private static void writeWait(WriteQueue queue, ExecutorService executor) throws InterruptedException {
queue.doneAdding = true;
executor.shutdown();
try {
if (executor.awaitTermination(60, TimeUnit.MINUTES) == false) {
executor.shutdownNow();
}
}
catch (InterruptedException e) {
executor.shutdownNow();
Thread.currentThread().interrupt();
}
//Encourage the JVM to release memory used while decompressing
GC_RUNNER.execute(System::gc);
}