Fix: race condition on shutdown of zip extractor
This commit is contained in:
committed by
laurent
parent
912a07850f
commit
54b5a6ca6c
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user