From 742f8cb753ef3154b3f5fa2dbfc9fc18f23812d4 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Fri, 6 Dec 2024 18:45:34 +0100 Subject: [PATCH] dump thread depending on env var and set name for Controller thread --- core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java | 1 + core/src/main/java/lucee/runtime/engine/Controler.java | 5 ++++- loader/build.xml | 2 +- loader/pom.xml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java b/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java index 8a7779c614..e1be530376 100644 --- a/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java +++ b/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java @@ -456,6 +456,7 @@ else if (installExtensions && (updateInfo.updateType == ConfigFactory.NEW_MINOR controler = new Controler(cs, initContextes, 5 * 1000, controlerState); controler.setDaemon(true); + controler.setName("Controller"); controler.setPriority(Thread.MIN_PRIORITY); boolean disabled = Caster.toBooleanValue(SystemUtil.getSystemPropOrEnvVar(SystemUtil.SETTING_CONTROLLER_DISABLED, null), false); diff --git a/core/src/main/java/lucee/runtime/engine/Controler.java b/core/src/main/java/lucee/runtime/engine/Controler.java index 10148130cc..5b4ad43b23 100755 --- a/core/src/main/java/lucee/runtime/engine/Controler.java +++ b/core/src/main/java/lucee/runtime/engine/Controler.java @@ -136,10 +136,12 @@ public void run() { public void run() { // scheduleThread.start(); boolean firstRun = true; + boolean dump = Caster.toBooleanValue(SystemUtil.getSystemPropOrEnvVar("lucee.dump.threads", null), false); + long count = 0; List threads = new ArrayList(); CFMLFactoryImpl factories[] = null; while (state.active()) { - dumpThreads(); + if (dump) dumpThreads(); // sleep SystemUtil.wait(this, interval); if (!state.active()) break; @@ -147,6 +149,7 @@ public void run() { factories = toFactories(factories, contextes); // start the thread that calls control ControlerThread ct = new ControlerThread(this, factories, firstRun, configServer.getLog("application")); + ct.setName("ControllerThread:" + (++count)); ct.start(); threads.add(ct); diff --git a/loader/build.xml b/loader/build.xml index 2bd37a6129..06fac8af2a 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 481c350cf7..1ad595f3e1 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.181-SNAPSHOT + 6.2.0.182-SNAPSHOT jar Lucee Loader Build