From 9ca19a0bc236b1b8ca4e14fce7edf1578e4e8147 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Tue, 22 Oct 2024 09:05:08 +0200 Subject: [PATCH] Fix for RejectedExecutionException during delete operations If the tasks scheduled by ForkJoinPool are all busy and new task is added, the pool would throw RejectedExecutionException if the "saturate" Predicate is not specified. To avoid that, supply Predicate that is always true - with that, no exception will be thrown on busy pool and we would not reject new delete operations. Fixes https://github.com/eclipse-platform/eclipse.platform/issues/1592 --- .../org/eclipse/core/internal/filesystem/local/LocalFile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java index 0870195db76..4ae0505ac52 100644 --- a/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java +++ b/resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java @@ -287,7 +287,8 @@ private static ForkJoinPool createExecutor(int threadCount) { /* asyncMode */ false, // Last-In-First-Out is important to delete child before parent folders /* corePoolSize */ 0, // /* maximumPoolSize */ threadCount, // - /* minimumRunnable */ 0, null, // delete algorithm does not need any + /* minimumRunnable */ 0, // + pool -> true, // if maximumPoolSize would be exceeded, don't throw RejectedExecutionException /* keepAliveTime */ 1, TimeUnit.MINUTES); // pool terminates 1 thread per }