diff --git a/core/src/main/java/lucee/runtime/debug/DebuggerPool.java b/core/src/main/java/lucee/runtime/debug/DebuggerPool.java index 8c4d73e3d7..6a3304fb48 100644 --- a/core/src/main/java/lucee/runtime/debug/DebuggerPool.java +++ b/core/src/main/java/lucee/runtime/debug/DebuggerPool.java @@ -19,8 +19,10 @@ package lucee.runtime.debug; import java.util.Iterator; -import java.util.LinkedList; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import lucee.commons.io.log.LogUtil; import lucee.commons.io.res.Resource; import lucee.runtime.PageContext; import lucee.runtime.config.ConfigWebPro; @@ -32,33 +34,32 @@ public class DebuggerPool { - // private Resource storage; - private LinkedList queue = new LinkedList(); - // private List list=new ArrayList(); + // private LinkedList queue = new LinkedList(); + private Queue queue = new ConcurrentLinkedQueue<>(); public DebuggerPool(Resource storage) { // this.storage=storage; } - public void store(PageContext pc, Debugger debugger) { + public void store(PageContext pc, DebuggerImpl debugger) { if (ReqRspUtil.getScriptName(pc, pc.getHttpServletRequest()).indexOf("/lucee/") == 0) return; + try { queue.add(debugger.getDebuggingData(pc, true)); } catch (PageException e) { + LogUtil.log(pc, "debugger", e); } - while (queue.size() > ((ConfigWebPro) pc.getConfig()).getDebugMaxRecordsLogged()) + // on overflow + while (queue.size() > ((ConfigWebPro) pc.getConfig()).getDebugMaxRecordsLogged()) { queue.poll(); - + } } public Array getData(PageContext pc) { - Iterator it; - synchronized (queue) { - it = queue.iterator(); - } Array arr = new ArrayImpl(); + Iterator it = queue.iterator(); while (it.hasNext()) { arr.appendEL(it.next()); } @@ -66,9 +67,6 @@ public Array getData(PageContext pc) { } public void purge() { - synchronized (queue) { - queue.clear(); - } + queue.clear(); } - } diff --git a/loader/build.xml b/loader/build.xml index 2b7a2bd4ff..58e743a2d4 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 13bd87ec8d..296365577d 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.81-SNAPSHOT + 6.2.0.82-SNAPSHOT jar Lucee Loader Build