Skip to content

Commit 9ca19a0

Browse files
committed
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 #1592
1 parent 31d84d1 commit 9ca19a0

File tree

1 file changed

+2
-1
lines changed
  • resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local

1 file changed

+2
-1
lines changed

resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ private static ForkJoinPool createExecutor(int threadCount) {
287287
/* asyncMode */ false, // Last-In-First-Out is important to delete child before parent folders
288288
/* corePoolSize */ 0, //
289289
/* maximumPoolSize */ threadCount, //
290-
/* minimumRunnable */ 0, null, // delete algorithm does not need any
290+
/* minimumRunnable */ 0, //
291+
pool -> true, // if maximumPoolSize would be exceeded, don't throw RejectedExecutionException
291292
/* keepAliveTime */ 1, TimeUnit.MINUTES); // pool terminates 1 thread per
292293
}
293294

0 commit comments

Comments
 (0)