From fc8677617b13ebd7c0e20a3b93ce2cbf6cefebe6 Mon Sep 17 00:00:00 2001 From: Rene Pfeuffer Date: Mon, 2 Dec 2019 08:49:31 +0100 Subject: [PATCH] Disable StopThreadsCleanUp When this is enabled, we get timeouts on some machines (seems to depend on the number of cores) when the server is stopped which leads to an error when the integration tests are run (the server cannot be stopped fast enough when the integration tests are finished in webapp and shall be started for scm-it). --- .../scm/lifecycle/classloading/ClassLoaderLifeCycle.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scm-webapp/src/main/java/sonia/scm/lifecycle/classloading/ClassLoaderLifeCycle.java b/scm-webapp/src/main/java/sonia/scm/lifecycle/classloading/ClassLoaderLifeCycle.java index 24d1c239b4..de2480f563 100644 --- a/scm-webapp/src/main/java/sonia/scm/lifecycle/classloading/ClassLoaderLifeCycle.java +++ b/scm-webapp/src/main/java/sonia/scm/lifecycle/classloading/ClassLoaderLifeCycle.java @@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory; import se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventor; import se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventorFactory; import se.jiderhamn.classloader.leak.prevention.cleanup.MBeanCleanUp; +import se.jiderhamn.classloader.leak.prevention.cleanup.StopThreadsCleanUp; import se.jiderhamn.classloader.leak.prevention.preinit.SunAwtAppContextInitiator; import sonia.scm.lifecycle.LifeCycle; import sonia.scm.plugin.ChildFirstPluginClassLoader; @@ -43,6 +44,9 @@ public final class ClassLoaderLifeCycle implements LifeCycle { classLoaderLeakPreventorFactory.removePreInitiator(SunAwtAppContextInitiator.class); // the MBeanCleanUp causes a Exception and we use no mbeans classLoaderLeakPreventorFactory.removeCleanUp(MBeanCleanUp.class); + // the StopThreadsCleanUp leads to timeouts on shutdown - we try to stop our threads on our own + classLoaderLeakPreventorFactory.removeCleanUp(StopThreadsCleanUp.class); + return new ClassLoaderLifeCycle(Thread.currentThread().getContextClassLoader(), classLoaderLeakPreventorFactory); }