Skip to content

Commit

Permalink
Update ControlledWorkerScheduler.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bgprudhomme authored Aug 5, 2024
1 parent 1868faf commit 2bd6e75
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.eclipse.rdf4j.common.iteration.CloseableIteration;
Expand Down Expand Up @@ -117,8 +117,10 @@ public int getNumberOfTasks() {
}

private ExecutorService createExecutorService() {

ExecutorService executor = Executors.newThreadPerTaskExecutor(new NamingThreadFactory(name));
// Refactoring this causes ServicesTest to hang forever (https://github.com/ponder-lab/rdf4j/actions/runs/10239404923/job/28324948852?pr=2)
ThreadPoolExecutor executor = new ThreadPoolExecutor(nWorkers, nWorkers, 60L, TimeUnit.SECONDS, _taskQueue,
new NamingThreadFactory(name));
executor.allowCoreThreadTimeOut(true);
return executor;
}

Expand Down

0 comments on commit 2bd6e75

Please sign in to comment.