Skip to content

Commit

Permalink
Revert "Use a dedicated thread pool rather than Timer.get for Durable…
Browse files Browse the repository at this point in the history
…TaskStep.Execution.check, since it has often been observed to block for a while." (#81)

This reverts commit c9c1364.
  • Loading branch information
jglick committed Nov 23, 2021
1 parent 08e8ce1 commit f832bc1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -210,7 +211,10 @@ interface ExecutionRemotable {
public static long REMOTE_TIMEOUT = Integer.parseInt(System.getProperty(DurableTaskStep.class.getName() + ".REMOTE_TIMEOUT", "20"));

private static ScheduledThreadPoolExecutor threadPool;
private static synchronized ScheduledThreadPoolExecutor threadPool() {
private static synchronized ScheduledExecutorService threadPool() {
if (USE_WATCHING) {
return Timer.get();
}
if (threadPool == null) {
threadPool = new ScheduledThreadPoolExecutor(25, new NamingThreadFactory(new DaemonThreadFactory(), DurableTaskStep.class.getName()));
threadPool.setKeepAliveTime(1, TimeUnit.MINUTES);
Expand Down

0 comments on commit f832bc1

Please sign in to comment.