Merge branch 'fix/race-condition-unzip' into 'master'
Fix: race condition on shutdown of zip extractor See merge request sheepitrenderfarm/client!347
This commit is contained in:
@@ -245,6 +245,17 @@ public class UnzipUtils {
|
|||||||
private static void writeWait(WriteQueue queue, ExecutorService executor) throws InterruptedException {
|
private static void writeWait(WriteQueue queue, ExecutorService executor) throws InterruptedException {
|
||||||
queue.doneAdding = true;
|
queue.doneAdding = true;
|
||||||
executor.shutdown();
|
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
|
//Encourage the JVM to release memory used while decompressing
|
||||||
GC_RUNNER.execute(System::gc);
|
GC_RUNNER.execute(System::gc);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user