From 816e9db44843b47918cef2ccb710d51e1efc3879 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Wed, 26 Aug 2020 16:30:14 +0200 Subject: [PATCH] Disabled async stacktraces temporarily --- .../executor/AsyncStackTraceExecutorServiceDecorator.java | 7 +++++++ .../executor/SimplerExecutorServiceDecorator.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java b/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java index 5fac5a2..d4be997 100644 --- a/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java +++ b/src/main/java/org/warp/commonutils/concurrency/executor/AsyncStackTraceExecutorServiceDecorator.java @@ -5,8 +5,15 @@ import org.jetbrains.annotations.NotNull; public class AsyncStackTraceExecutorServiceDecorator extends SimplerExecutorServiceDecorator { + // todo: Fix async stacktrace performance and memory problems + private static final boolean DISABLE_ASYNC_STACKTRACES_GLOBALLY = true; + public AsyncStackTraceExecutorServiceDecorator(ExecutorService executorService) { super(executorService, (executor) -> { + if (DISABLE_ASYNC_STACKTRACES_GLOBALLY) { + return executor; + } + // Do nothing if it has already the asyncstacktrace executor service decorator if (executorService instanceof ExecutorServiceDecorator) { var decorators = ((ExecutorServiceDecorator) executorService).getExecutorServiceDecorators(); diff --git a/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java b/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java index 58e7f18..ecac3fa 100644 --- a/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java +++ b/src/main/java/org/warp/commonutils/concurrency/executor/SimplerExecutorServiceDecorator.java @@ -14,10 +14,10 @@ import org.jetbrains.annotations.NotNull; public abstract class SimplerExecutorServiceDecorator extends ExecutorServiceDecorator { - private final ExecutorDecorator executorDecorator; + private final Executor executorDecorator; public SimplerExecutorServiceDecorator(ExecutorService executorService, - Function executorDecoratorInitializer) { + Function executorDecoratorInitializer) { super(executorService); this.executorDecorator = executorDecoratorInitializer.apply(executorService); }