From 17867dc0a7a37bff431b79e3ff512f2939a597bf Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 20 Oct 2017 09:44:08 +1100 Subject: [PATCH] improved QueuedThreadPool dump --- .../jetty/util/thread/QueuedThreadPool.java | 18 +++++++++++++++--- .../util/thread/ReservedThreadExecutor.java | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 92b6204bc14..0a0ed6a9850 100755 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -526,15 +526,27 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo String knownMethod = ""; for (StackTraceElement t : trace) { - if ("idleJobPoll".equals(t.getMethodName())) + if ("idleJobPoll".equals(t.getMethodName()) && t.getClassName().endsWith("QueuedThreadPool")) { knownMethod = "IDLE "; break; } - if ("preallocatedWait".equals(t.getMethodName())) + if ("reservedWait".equals(t.getMethodName()) && t.getClassName().endsWith("ReservedThread")) { - knownMethod = "PREALLOCATED "; + knownMethod = "RESERVED "; + break; + } + + if ("select".equals(t.getMethodName()) && t.getClassName().endsWith("SelectorProducer")) + { + knownMethod = "SELECTING "; + break; + } + + if ("accept".equals(t.getMethodName()) && t.getClassName().contains("ServerConnector")) + { + knownMethod = "ACCEPTING "; break; } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java index 0c8a2d9b6ee..3f8ea905a51 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java @@ -256,8 +256,8 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements Executo public String toString() { if (_owner==null) - return String.format("%s@%x{s=%d,p=%d}",this.getClass().getSimpleName(),hashCode(),_size.get(),_pending.get()); - return String.format("%s@%s{s=%d,p=%d}",this.getClass().getSimpleName(),_owner,_size.get(),_pending.get()); + return String.format("%s@%x{s=%d/%d,p=%d}",this.getClass().getSimpleName(),hashCode(),_size.get(),_capacity,_pending.get()); + return String.format("%s@%s{s=%d/%d,p=%d}",this.getClass().getSimpleName(),_owner,_size.get(),_capacity,_pending.get()); } private class ReservedThread extends ConcurrentStack.Node implements Runnable