From 0a59a2b0909383de7db8bdd2b69e2f0c869bcd09 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 3 Sep 2020 06:57:18 +1000 Subject: [PATCH 1/4] Issue #5201 - simplify the QueuedThreadPool detailed dump Signed-off-by: Lachlan Roberts --- .../jetty/util/thread/QueuedThreadPool.java | 87 ++++++------------- 1 file changed, 26 insertions(+), 61 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 88877aedaba7..a24b8703487f 100644 --- 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 @@ -701,74 +701,39 @@ protected void removeThread(Thread thread) public void dump(Appendable out, String indent) throws IOException { List threads = new ArrayList<>(getMaxThreads()); - for (final Thread thread : _threads) + for (Thread thread : _threads) { - final StackTraceElement[] trace = thread.getStackTrace(); - String knownMethod = ""; - for (StackTraceElement t : trace) - { - if ("idleJobPoll".equals(t.getMethodName()) && t.getClassName().equals(Runner.class.getName())) - { - knownMethod = "IDLE "; - break; - } - - if ("reservedWait".equals(t.getMethodName()) && t.getClassName().endsWith("ReservedThread")) - { - 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; - } - } - final String known = knownMethod; - - if (isDetailedDump()) - { - threads.add(new Dumpable() - { - @Override - public void dump(Appendable out, String indent) throws IOException - { - if (StringUtil.isBlank(known)) - Dumpable.dumpObjects(out, indent, String.format("%s %s %s %d", thread.getId(), thread.getName(), thread.getState(), thread.getPriority()), (Object[])trace); - else - Dumpable.dumpObjects(out, indent, String.format("%s %s %s %s %d", thread.getId(), thread.getName(), known, thread.getState(), thread.getPriority())); - } - - @Override - public String dump() - { - return null; - } - }); - } + StackTraceElement[] trace = thread.getStackTrace(); + String known = getKnownMethod(trace); + String baseThreadInfo = String.format("%s %s %s %d", thread.getId(), thread.getName(), thread.getState(), thread.getPriority()); + + if (!StringUtil.isBlank(known)) + threads.add(baseThreadInfo + " " + known); + else if (isDetailedDump()) + threads.add((Dumpable)(o, i) -> Dumpable.dumpObjects(o, i, baseThreadInfo, (Object[])trace)); else - { - int p = thread.getPriority(); - threads.add(thread.getId() + " " + thread.getName() + " " + known + thread.getState() + " @ " + (trace.length > 0 ? trace[0] : "???") + (p == Thread.NORM_PRIORITY ? "" : (" prio=" + p))); - } + threads.add(baseThreadInfo + " @ " + (trace.length > 0 ? trace[0].toString() : "???")); } + dumpObjects(out, indent, new DumpableCollection("threads", threads)); if (isDetailedDump()) + dumpObjects(out, indent, new DumpableCollection("jobs", new ArrayList<>(getQueue()))); + } + + private String getKnownMethod(StackTraceElement[] trace) + { + for (StackTraceElement t : trace) { - List jobs = new ArrayList<>(getQueue()); - dumpObjects(out, indent, new DumpableCollection("threads", threads), new DumpableCollection("jobs", jobs)); - } - else - { - dumpObjects(out, indent, new DumpableCollection("threads", threads)); + if ("idleJobPoll".equals(t.getMethodName()) && t.getClassName().equals(Runner.class.getName())) + return "IDLE"; + if ("reservedWait".equals(t.getMethodName()) && t.getClassName().endsWith("ReservedThread")) + return "RESERVED"; + if ("select".equals(t.getMethodName()) && t.getClassName().endsWith("SelectorProducer")) + return "SELECTING"; + if ("accept".equals(t.getMethodName()) && t.getClassName().contains("ServerConnector")) + return "ACCEPTING"; } + return ""; } @Override From 85c8c6510e9e4e00edf23af3037100e08944940b Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 3 Sep 2020 10:34:18 +1000 Subject: [PATCH 2/4] Issue #5201 - Fix issues with test after changes to QTP dump Signed-off-by: Lachlan Roberts --- .../jetty/util/thread/QueuedThreadPool.java | 6 +++-- .../util/thread/QueuedThreadPoolTest.java | 22 +++++++++---------- 2 files changed, 15 insertions(+), 13 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 a24b8703487f..3629a1f2df19 100644 --- 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 @@ -715,9 +715,11 @@ else if (isDetailedDump()) threads.add(baseThreadInfo + " @ " + (trace.length > 0 ? trace[0].toString() : "???")); } - dumpObjects(out, indent, new DumpableCollection("threads", threads)); + DumpableCollection threadsDump = new DumpableCollection("threads", threads); if (isDetailedDump()) - dumpObjects(out, indent, new DumpableCollection("jobs", new ArrayList<>(getQueue()))); + dumpObjects(out, indent, threadsDump, new DumpableCollection("jobs", new ArrayList<>(getQueue()))); + else + dumpObjects(out, indent, threadsDump); } private String getKnownMethod(StackTraceElement[] trace) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java index d3e5c5170efd..d2f0e745762a 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java @@ -778,8 +778,8 @@ public void testDump() throws Exception assertThat(count(dump, " - STARTED"), is(2)); assertThat(dump, containsString(",3<=3<=4,i=3,r=2,q=0")); assertThat(dump, containsString("[ReservedThreadExecutor@")); - assertThat(count(dump, " IDLE "), is(3)); - assertThat(count(dump, " RESERVED "), is(0)); + assertThat(count(dump, " IDLE"), is(3)); + assertThat(count(dump, " RESERVED"), is(0)); CountDownLatch started = new CountDownLatch(1); CountDownLatch waiting = new CountDownLatch(1); @@ -801,9 +801,9 @@ public void testDump() throws Exception assertThat(count(dump, " - STARTED"), is(2)); assertThat(dump, containsString(",3<=3<=4,i=2,r=2,q=0")); assertThat(dump, containsString("[ReservedThreadExecutor@")); - assertThat(count(dump, " IDLE "), is(2)); - assertThat(count(dump, " WAITING "), is(1)); - assertThat(count(dump, " RESERVED "), is(0)); + assertThat(count(dump, " IDLE"), is(2)); + assertThat(count(dump, " WAITING"), is(1)); + assertThat(count(dump, " RESERVED"), is(0)); assertThat(count(dump, "QueuedThreadPoolTest.lambda$testDump$"), is(0)); pool.setDetailedDump(true); @@ -812,9 +812,9 @@ public void testDump() throws Exception assertThat(dump, containsString(",3<=3<=4,i=2,r=2,q=0")); assertThat(dump, containsString("s=0/2")); assertThat(dump, containsString("[ReservedThreadExecutor@")); - assertThat(count(dump, " IDLE "), is(2)); - assertThat(count(dump, " WAITING "), is(1)); - assertThat(count(dump, " RESERVED "), is(0)); + assertThat(count(dump, " IDLE"), is(2)); + assertThat(count(dump, " WAITING"), is(1)); + assertThat(count(dump, " RESERVED"), is(0)); assertThat(count(dump, "QueuedThreadPoolTest.lambda$testDump$"), is(1)); assertFalse(pool.tryExecute(() -> @@ -827,9 +827,9 @@ public void testDump() throws Exception assertThat(dump, containsString(",3<=3<=4,i=1,r=2,q=0")); assertThat(dump, containsString("s=1/2")); assertThat(dump, containsString("[ReservedThreadExecutor@")); - assertThat(count(dump, " IDLE "), is(1)); - assertThat(count(dump, " WAITING "), is(1)); - assertThat(count(dump, " RESERVED "), is(1)); + assertThat(count(dump, " IDLE"), is(1)); + assertThat(count(dump, " WAITING"), is(1)); + assertThat(count(dump, " RESERVED"), is(1)); assertThat(count(dump, "QueuedThreadPoolTest.lambda$testDump$"), is(1)); } From 516432b9cbd47f3a9987d6dbcdfb690b1cc6baeb Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 3 Sep 2020 15:06:02 +1000 Subject: [PATCH 3/4] Update server dump documentation after QueuedThreadPool dump changes Signed-off-by: Lachlan Roberts --- .../logging/jetty-server-dump.adoc | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc index 103e0ba3176d..2ba6493d0966 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc @@ -80,26 +80,26 @@ The Server MBean has a `dump()` method, which dumps everything, plus a `dumpStdE This is a dump of the OneServletContext embedded example with extra threadpool information: .... -Server@59906517{STARTED}[9.4.32-SNAPSHOT] - STARTED -+= QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}] - STARTED -| += ReservedThreadExecutor@77e4c80f{s=0/4,p=0} - STARTED +Server@5ed828d{STARTED}[9.4.32-SNAPSHOT] - STARTED ++= QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED +| += ReservedThreadExecutor@77e4c80f{s=0/1,p=0} - STARTED | +> threads size=8 -| | +> 12 qtp1740189450-12 SELECTING RUNNABLE 5 -| | +> 14 qtp1740189450-14-acceptor-0@4c78251c-ServerConnector@76707e36{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} ACCEPTING RUNNABLE 3 -| | +> 16 qtp1740189450-16 IDLE TIMED_WAITING 5 -| | +> 18 qtp1740189450-18 IDLE TIMED_WAITING 5 -| | +> 15 qtp1740189450-15 SELECTING RUNNABLE 5 -| | +> 19 qtp1740189450-19 IDLE TIMED_WAITING 5 -| | +> 17 qtp1740189450-17 IDLE TIMED_WAITING 5 -| | +> 13 qtp1740189450-13 IDLE TIMED_WAITING 5 +| | +> 13 qtp731260860-13 RUNNABLE 5 SELECTING +| | +> 15 qtp731260860-15 TIMED_WAITING 5 IDLE +| | +> 17 qtp731260860-17 TIMED_WAITING 5 IDLE +| | +> 14 qtp731260860-14-acceptor-0@2bf41367-ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} RUNNABLE 3 ACCEPTING +| | +> 18 qtp731260860-18 TIMED_WAITING 5 IDLE +| | +> 19 qtp731260860-19 TIMED_WAITING 5 IDLE +| | +> 16 qtp731260860-16 TIMED_WAITING 5 IDLE +| | +> 12 qtp731260860-12 RUNNABLE 5 SELECTING | +> jobs size=0 -+= ServerConnector@76707e36{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED -| +~ Server@59906517{STARTED}[9.4.32-SNAPSHOT] - STARTED -| +~ QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}] - STARTED -| += ScheduledExecutorScheduler@7fe8ea47{STARTED} - STARTED -| +- org.eclipse.jetty.io.ArrayByteBufferPool@226a82c4 -| += HttpConnectionFactory@711f39f9[HTTP/1.1] - STARTED -| | +- HttpConfiguration@731f8236{32768/8192,8192/8192,https://:0,[]} ++= ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED +| +~ Server@5ed828d{STARTED}[9.4.32-SNAPSHOT] - STARTED +| +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED +| += ScheduledExecutorScheduler@35fc6dc4{STARTED} - STARTED +| +- org.eclipse.jetty.io.ArrayByteBufferPool@7fe8ea47 +| += HttpConnectionFactory@71bbf57e[HTTP/1.1] - STARTED +| | +- HttpConfiguration@226a82c4{32768/8192,8192/8192,https://:0,[]} | | +> customizers size=0 | | +> formEncodedMethods size=2 | | | +> POST @@ -125,65 +125,65 @@ Server@59906517{STARTED}[9.4.32-SNAPSHOT] - STARTED | | +> setRequestCookieCompliance=RFC6265 | | +> notifyRemoteAsyncErrors=true | | +> relativeRedirectAllowed=false -| += SelectorManager@ServerConnector@76707e36{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED -| | += ManagedSelector@564718df{STARTED} id=0 keys=0 selected=0 updates=0 - STARTED -| | | += EatWhatYouKill@51b7e5df/SelectorProducer@18a70f16/PRODUCING/p=false/QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-08-26T08:51:02.711784+10:00 - STARTED -| | | | +- SelectorProducer@18a70f16 -| | | | +~ QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}] - STARTED -| | | +> updates @ 2020-08-26T08:51:02.705944+10:00 size=0 -| | | +> keys @ 2020-08-26T08:51:02.706914+10:00 size=0 -| | += ManagedSelector@62e136d3{STARTED} id=1 keys=0 selected=0 updates=0 - STARTED -| | += EatWhatYouKill@c8e4bb0/SelectorProducer@6279cee3/PRODUCING/p=false/QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-08-26T08:51:02.717119+10:00 - STARTED -| | | +- SelectorProducer@6279cee3 -| | | +~ QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}] - STARTED -| | +> updates @ 2020-08-26T08:51:02.715887+10:00 size=0 -| | +> keys @ 2020-08-26T08:51:02.716158+10:00 size=0 +| += SelectorManager@ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED +| | += ManagedSelector@2b4a2ec7{STARTED} id=0 keys=0 selected=0 updates=0 - STARTED +| | | += EatWhatYouKill@564718df/SelectorProducer@51b7e5df/PRODUCING/p=false/QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-09-03T15:01:52.497766+10:00 - STARTED +| | | | +- SelectorProducer@51b7e5df +| | | | +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED +| | | +> updates @ 2020-09-03T15:01:52.493299+10:00 size=0 +| | | +> keys @ 2020-09-03T15:01:52.494024+10:00 size=0 +| | += ManagedSelector@18a70f16{STARTED} id=1 keys=0 selected=0 updates=0 - STARTED +| | += EatWhatYouKill@62e136d3/SelectorProducer@c8e4bb0/PRODUCING/p=false/QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-09-03T15:01:52.499773+10:00 - STARTED +| | | +- SelectorProducer@c8e4bb0 +| | | +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED +| | +> updates @ 2020-09-03T15:01:52.498655+10:00 size=0 +| | +> keys @ 2020-09-03T15:01:52.49884+10:00 size=0 | +- sun.nio.ch.ServerSocketChannelImpl[/0:0:0:0:0:0:0:0:8080] -| +- qtp1740189450-14-acceptor-0@4c78251c-ServerConnector@76707e36{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} -+= AttributeContainerMap@4206a205{size=0} - STARTED -+= o.e.j.s.ServletContextHandler@4ba2ca36{/,file:///tmp/,AVAILABLE} - STARTED -| += org.eclipse.jetty.server.session.SessionHandler2007331442==dftMaxIdleSec=-1 - STARTED -| | += ServletHandler@29ba4338{STARTED} - STARTED -| | | +> listeners ServletHandler@29ba4338{STARTED} size=2 -| | | | +> ListenerHolder@57175e74{STARTED}: org.eclipse.jetty.embedded.OneServletContext$InitListener - STARTED -| | | | +> ListenerHolder@7bb58ca3{STARTED}: org.eclipse.jetty.embedded.OneServletContext$RequestListener - STARTED -| | | +> filters ServletHandler@29ba4338{STARTED} size=2 -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-29b5cd00@29b5cd00==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED -| | | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@c540f5a -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-7113b13f@7113b13f==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@770c2e6b -| | | +> filterMappings ServletHandler@29ba4338{STARTED} size=2 -| | | | +> [/test/*]/[]/[REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-29b5cd00 -| | | | +> [*.test]/[]/[REQUEST, ASYNC]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-7113b13f -| | | +> servlets ServletHandler@29ba4338{STARTED} size=3 -| | | | +> org.eclipse.jetty.embedded.HelloServlet-6b57696f@99887e98==org.eclipse.jetty.embedded.HelloServlet,jsp=null,order=-1,inst=false,async=true - STARTED +| +- qtp731260860-14-acceptor-0@2bf41367-ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} ++= AttributeContainerMap@6279cee3{size=0} - STARTED ++= o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} - STARTED +| += org.eclipse.jetty.server.session.SessionHandler1904324159==dftMaxIdleSec=-1 - STARTED +| | += ServletHandler@4206a205{STARTED} - STARTED +| | | +> listeners ServletHandler@4206a205{STARTED} size=2 +| | | | +> ListenerHolder@29ba4338{STARTED}: org.eclipse.jetty.embedded.OneServletContext$InitListener - STARTED +| | | | +> ListenerHolder@57175e74{STARTED}: org.eclipse.jetty.embedded.OneServletContext$RequestListener - STARTED +| | | +> filters ServletHandler@4206a205{STARTED} size=2 +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-44c8afef@44c8afef==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED +| | | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@7bb58ca3 +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-46daef40@46daef40==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@c540f5a +| | | +> filterMappings ServletHandler@4206a205{STARTED} size=2 +| | | | +> [/test/*]/[]/[REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-44c8afef +| | | | +> [*.test]/[]/[ASYNC, REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-46daef40 +| | | +> servlets ServletHandler@4206a205{STARTED} size=3 +| | | | +> org.eclipse.jetty.embedded.HelloServlet-42d8062c@2eda1f60==org.eclipse.jetty.embedded.HelloServlet,jsp=null,order=-1,inst=false,async=true - STARTED | | | | | +> class org.eclipse.jetty.embedded.HelloServlet | | | | +> debug@5b09653==org.eclipse.jetty.embedded.DumpServlet,jsp=null,order=-1,inst=false,async=true - STARTED | | | | | +> class org.eclipse.jetty.embedded.DumpServlet -| | | | +> org.eclipse.jetty.servlet.DefaultServlet-38bc8ab5@f1bd2681==org.eclipse.jetty.servlet.DefaultServlet,jsp=null,order=-1,inst=false,async=true - STARTED +| | | | +> org.eclipse.jetty.servlet.DefaultServlet-59906517@ad9ec77f==org.eclipse.jetty.servlet.DefaultServlet,jsp=null,order=-1,inst=false,async=true - STARTED | | | | +> class org.eclipse.jetty.servlet.DefaultServlet -| | | +> servletMappings ServletHandler@29ba4338{STARTED} size=4 -| | | +> [/hello/*]=>org.eclipse.jetty.embedded.HelloServlet-6b57696f +| | | +> servletMappings ServletHandler@4206a205{STARTED} size=4 +| | | +> [/hello/*]=>org.eclipse.jetty.embedded.HelloServlet-42d8062c | | | +> [/dump/*]=>debug | | | +> [*.dump]=>debug -| | | +> [/]=>org.eclipse.jetty.servlet.DefaultServlet-38bc8ab5 -| | += org.eclipse.jetty.server.session.DefaultSessionCache@6328d34a[evict=-1,removeUnloadable=false,saveOnCreate=false,saveOnInactiveEvict=false] - STARTED -| | | += org.eclipse.jetty.server.session.NullSessionDataStore@145eaa29[passivating=false,graceSec=3600] - STARTED -| | +~ DefaultSessionIdManager@15bb6bea{STARTED}[worker=node0] - STARTED +| | | +> [/]=>org.eclipse.jetty.servlet.DefaultServlet-59906517 +| | += org.eclipse.jetty.server.session.DefaultSessionCache@2357d90a[evict=-1,removeUnloadable=false,saveOnCreate=false,saveOnInactiveEvict=false] - STARTED +| | | += org.eclipse.jetty.server.session.NullSessionDataStore@6328d34a[passivating=false,graceSec=3600] - STARTED +| | +~ DefaultSessionIdManager@145eaa29{STARTED}[worker=node0] - STARTED | +> No ClassLoader -| +> eventListeners o.e.j.s.ServletContextHandler@4ba2ca36{/,file:///tmp/,AVAILABLE} size=2 -| | +> org.eclipse.jetty.embedded.OneServletContext$InitListener@8b96fde -| | +> org.eclipse.jetty.embedded.OneServletContext$RequestListener@2d2e5f00 -| +> handler attributes o.e.j.s.ServletContextHandler@4ba2ca36{/,file:///tmp/,AVAILABLE} size=1 -| | +> org.eclipse.jetty.server.Executor=QueuedThreadPool[qtp1740189450]@67b92f0a{STARTED,8<=8<=200,i=5,r=4,q=0}[ReservedThreadExecutor@77e4c80f{s=0/4,p=0}] -| +> context attributes o.e.j.s.ServletContextHandler@4ba2ca36{/,file:///tmp/,AVAILABLE} size=2 +| +> eventListeners o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=2 +| | +> org.eclipse.jetty.embedded.OneServletContext$InitListener@15bb6bea +| | +> org.eclipse.jetty.embedded.OneServletContext$RequestListener@8b96fde +| +> handler attributes o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=1 +| | +> org.eclipse.jetty.server.Executor=QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] +| +> context attributes o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=2 | | +> org.eclipse.jetty.util.DecoratedObjectFactory=org.eclipse.jetty.util.DecoratedObjectFactory[decorators=1] | | +> X-Init=true -| +> initparams o.e.j.s.ServletContextHandler@4ba2ca36{/,file:///tmp/,AVAILABLE} size=0 -+= ErrorHandler@2ea6137{STARTED} - STARTED -+= DefaultSessionIdManager@15bb6bea{STARTED}[worker=node0] - STARTED -| += HouseKeeper@3439f68d{STARTED}[interval=660000, ownscheduler=true] - STARTED +| +> initparams o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=0 ++= ErrorHandler@4c40b76e{STARTED} - STARTED ++= DefaultSessionIdManager@145eaa29{STARTED}[worker=node0] - STARTED +| += HouseKeeper@dbd940d{STARTED}[interval=600000, ownscheduler=true] - STARTED +> jdk.internal.loader.ClassLoaders$AppClassLoader@2c13da15 - +> jdk.internal.loader.ClassLoaders$PlatformClassLoader@41ee392b + +> jdk.internal.loader.ClassLoaders$PlatformClassLoader@2ea6137 key: +- bean, += managed, +~ unmanaged, +? auto, +: iterable, +] array, +@ map, +> undefined .... From 1d1bbc49f750c3061682eee22bae332228387f21 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 4 Sep 2020 13:55:26 +1000 Subject: [PATCH 4/4] Issue #5201 - change format for QTP dump from review Signed-off-by: Lachlan Roberts --- .../logging/jetty-server-dump.adoc | 171 +++++++++++------- .../jetty/util/thread/QueuedThreadPool.java | 10 +- 2 files changed, 108 insertions(+), 73 deletions(-) diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc index 2ba6493d0966..e6e3777b11a4 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/jetty-server-dump.adoc @@ -80,26 +80,60 @@ The Server MBean has a `dump()` method, which dumps everything, plus a `dumpStdE This is a dump of the OneServletContext embedded example with extra threadpool information: .... -Server@5ed828d{STARTED}[9.4.32-SNAPSHOT] - STARTED -+= QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED -| += ReservedThreadExecutor@77e4c80f{s=0/1,p=0} - STARTED +Server@59906517{STARTED}[9.4.32-SNAPSHOT] - STARTED ++= QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}] - STARTED +| += ReservedThreadExecutor@16267862{s=2/4,p=0} - STARTED | +> threads size=8 -| | +> 13 qtp731260860-13 RUNNABLE 5 SELECTING -| | +> 15 qtp731260860-15 TIMED_WAITING 5 IDLE -| | +> 17 qtp731260860-17 TIMED_WAITING 5 IDLE -| | +> 14 qtp731260860-14-acceptor-0@2bf41367-ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} RUNNABLE 3 ACCEPTING -| | +> 18 qtp731260860-18 TIMED_WAITING 5 IDLE -| | +> 19 qtp731260860-19 TIMED_WAITING 5 IDLE -| | +> 16 qtp731260860-16 TIMED_WAITING 5 IDLE -| | +> 12 qtp731260860-12 RUNNABLE 5 SELECTING +| | +> qtp488044861-13 RUNNABLE tid=13 prio=5 SELECTING +| | +> qtp488044861-15-acceptor-0@296e0338-ServerConnector@1e6d1014{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} RUNNABLE tid=15 prio=3 ACCEPTING +| | +> qtp488044861-17 TIMED_WAITING tid=17 prio=5 RESERVED +| | +> qtp488044861-19 RUNNABLE tid=19 prio=5 +| | | +> app//org.eclipse.jetty.http.pathmap.PathMappings.getMatch(PathMappings.java:130) +| | | +> app//org.eclipse.jetty.servlet.ServletHandler.getMappedServlet(ServletHandler.java:591) +| | | +> app//org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:474) +| | | +> app//org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1582) +| | | +> app//org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) +| | | +> app//org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) +| | | +> app//org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) +| | | +> app//org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) +| | | +> app//org.eclipse.jetty.server.Server.handle(Server.java:516) +| | | +> app//org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383) +| | | +> app//org.eclipse.jetty.server.HttpChannel$$Lambda$102/0x000000010016d440.dispatch(Unknown Source) +| | | +> app//org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556) +| | | +> app//org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375) +| | | +> app//org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273) +| | | +> app//org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) +| | | +> app//org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) +| | | +> app//org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) +| | | +> app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) +| | | +> app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) +| | | +> app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) +| | | +> app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) +| | | +> app//org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375) +| | | +> app//org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773) +| | | +> app//org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905) +| | | +> java.base@11.0.5/java.lang.Thread.run(Thread.java:834) +| | +> qtp488044861-16 TIMED_WAITING tid=16 prio=5 RESERVED +| | +> qtp488044861-21 RUNNABLE tid=21 prio=5 SELECTING +| | +> qtp488044861-18 TIMED_WAITING tid=18 prio=5 IDLE +| | +> qtp488044861-14 TIMED_WAITING tid=14 prio=5 IDLE | +> jobs size=0 -+= ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED -| +~ Server@5ed828d{STARTED}[9.4.32-SNAPSHOT] - STARTED -| +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED -| += ScheduledExecutorScheduler@35fc6dc4{STARTED} - STARTED -| +- org.eclipse.jetty.io.ArrayByteBufferPool@7fe8ea47 -| += HttpConnectionFactory@71bbf57e[HTTP/1.1] - STARTED -| | +- HttpConfiguration@226a82c4{32768/8192,8192/8192,https://:0,[]} ++= ServerConnector@1e6d1014{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED +| +~ Server@59906517{STARTED}[9.4.32-SNAPSHOT] - STARTED +| +~ QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}] - STARTED +| += ScheduledExecutorScheduler@453da22c{STARTED} - STARTED +| | +> java.base@11.0.5/jdk.internal.misc.Unsafe.park(Native Method) +| | +> java.base@11.0.5/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) +| | +> java.base@11.0.5/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123) +| | +> java.base@11.0.5/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182) +| | +> java.base@11.0.5/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899) +| | +> java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054) +| | +> java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114) +| | +> java.base@11.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) +| | +> java.base@11.0.5/java.lang.Thread.run(Thread.java:834) +| +- org.eclipse.jetty.io.ArrayByteBufferPool@71248c21 +| += HttpConnectionFactory@3fd7a715[HTTP/1.1] - STARTED +| | +- HttpConfiguration@442675e1{32768/8192,8192/8192,https://:0,[]} | | +> customizers size=0 | | +> formEncodedMethods size=2 | | | +> POST @@ -125,65 +159,66 @@ Server@5ed828d{STARTED}[9.4.32-SNAPSHOT] - STARTED | | +> setRequestCookieCompliance=RFC6265 | | +> notifyRemoteAsyncErrors=true | | +> relativeRedirectAllowed=false -| += SelectorManager@ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED -| | += ManagedSelector@2b4a2ec7{STARTED} id=0 keys=0 selected=0 updates=0 - STARTED -| | | += EatWhatYouKill@564718df/SelectorProducer@51b7e5df/PRODUCING/p=false/QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-09-03T15:01:52.497766+10:00 - STARTED -| | | | +- SelectorProducer@51b7e5df -| | | | +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED -| | | +> updates @ 2020-09-03T15:01:52.493299+10:00 size=0 -| | | +> keys @ 2020-09-03T15:01:52.494024+10:00 size=0 -| | += ManagedSelector@18a70f16{STARTED} id=1 keys=0 selected=0 updates=0 - STARTED -| | += EatWhatYouKill@62e136d3/SelectorProducer@c8e4bb0/PRODUCING/p=false/QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-09-03T15:01:52.499773+10:00 - STARTED -| | | +- SelectorProducer@c8e4bb0 -| | | +~ QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] - STARTED -| | +> updates @ 2020-09-03T15:01:52.498655+10:00 size=0 -| | +> keys @ 2020-09-03T15:01:52.49884+10:00 size=0 +| += SelectorManager@ServerConnector@1e6d1014{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} - STARTED +| | += ManagedSelector@38364841{STARTED} id=0 keys=0 selected=0 updates=0 - STARTED +| | | += EatWhatYouKill@28c4711c/SelectorProducer@59717824/PRODUCING/p=false/QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}][pc=0,pic=0,pec=0,epc=0]@2020-09-04T10:57:20.077669+10:00 - STARTED +| | | | +- SelectorProducer@59717824 +| | | | +~ QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}] - STARTED +| | | +> updates @ 2020-09-04T10:57:20.058489+10:00 size=0 +| | | +> keys @ 2020-09-04T10:57:20.061714+10:00 size=0 +| | += ManagedSelector@146044d7{STARTED} id=1 keys=1 selected=0 updates=0 - STARTED +| | += EatWhatYouKill@1e9e725a/SelectorProducer@15d9bc04/PRODUCING/p=false/QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}][pc=0,pic=0,pec=1,epc=14]@2020-09-04T10:57:20.082696+10:00 - STARTED +| | | +- SelectorProducer@15d9bc04 +| | | +~ QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}] - STARTED +| | +> updates @ 2020-09-04T10:57:20.078661+10:00 size=0 +| | +> keys @ 2020-09-04T10:57:20.082035+10:00 size=1 +| | +> SelectionKey@74bb45ed{i=0}->SocketChannelEndPoint@569ef11f{l=/127.0.0.1:8080,r=/127.0.0.1:58702,OPEN,fill=-,flush=-,to=3/30000}{io=0/0,kio=0,kro=1}->HttpConnection@25b03990[p=HttpParser{s=CONTENT,0 of -1},g=HttpGenerator@218fb9fe{s=START}]=>HttpChannelOverHttp@648d33ab{s=HttpChannelState@717b7e16{s=HANDLING rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=54,c=false/false,a=HANDLING,uri=//localhost:8080/,age=4} | +- sun.nio.ch.ServerSocketChannelImpl[/0:0:0:0:0:0:0:0:8080] -| +- qtp731260860-14-acceptor-0@2bf41367-ServerConnector@614ddd49{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} -+= AttributeContainerMap@6279cee3{size=0} - STARTED -+= o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} - STARTED -| += org.eclipse.jetty.server.session.SessionHandler1904324159==dftMaxIdleSec=-1 - STARTED -| | += ServletHandler@4206a205{STARTED} - STARTED -| | | +> listeners ServletHandler@4206a205{STARTED} size=2 -| | | | +> ListenerHolder@29ba4338{STARTED}: org.eclipse.jetty.embedded.OneServletContext$InitListener - STARTED -| | | | +> ListenerHolder@57175e74{STARTED}: org.eclipse.jetty.embedded.OneServletContext$RequestListener - STARTED -| | | +> filters ServletHandler@4206a205{STARTED} size=2 -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-44c8afef@44c8afef==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED -| | | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@7bb58ca3 -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-46daef40@46daef40==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED -| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@c540f5a -| | | +> filterMappings ServletHandler@4206a205{STARTED} size=2 -| | | | +> [/test/*]/[]/[REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-44c8afef -| | | | +> [*.test]/[]/[ASYNC, REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-46daef40 -| | | +> servlets ServletHandler@4206a205{STARTED} size=3 -| | | | +> org.eclipse.jetty.embedded.HelloServlet-42d8062c@2eda1f60==org.eclipse.jetty.embedded.HelloServlet,jsp=null,order=-1,inst=false,async=true - STARTED +| +- qtp488044861-15-acceptor-0@296e0338-ServerConnector@1e6d1014{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} ++= AttributeContainerMap@473b46c3{size=0} - STARTED ++= o.e.j.s.ServletContextHandler@3ffcd140{/,file:///tmp/,AVAILABLE} - STARTED +| += org.eclipse.jetty.server.session.SessionHandler1089504328==dftMaxIdleSec=-1 - STARTED +| | += ServletHandler@516be40f{STARTED} - STARTED +| | | +> listeners ServletHandler@516be40f{STARTED} size=2 +| | | | +> ListenerHolder@3c0a50da{STARTED}: org.eclipse.jetty.embedded.OneServletContext$InitListener - STARTED +| | | | +> ListenerHolder@646be2c3{STARTED}: org.eclipse.jetty.embedded.OneServletContext$RequestListener - STARTED +| | | +> filters ServletHandler@516be40f{STARTED} size=2 +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-e874448@e874448==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED +| | | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@797badd3 +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter-60285225@60285225==org.eclipse.jetty.embedded.OneServletContext$TestFilter,inst=true,async=true - STARTED +| | | | +> org.eclipse.jetty.embedded.OneServletContext$TestFilter@77be656f +| | | +> filterMappings ServletHandler@516be40f{STARTED} size=2 +| | | | +> [/test/*]/[]/[REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-e874448 +| | | | +> [*.test]/[]/[ASYNC, REQUEST]=>org.eclipse.jetty.embedded.OneServletContext$TestFilter-60285225 +| | | +> servlets ServletHandler@516be40f{STARTED} size=3 +| | | | +> org.eclipse.jetty.embedded.HelloServlet-58c1670b@d20bf05b==org.eclipse.jetty.embedded.HelloServlet,jsp=null,order=-1,inst=false,async=true - STARTED | | | | | +> class org.eclipse.jetty.embedded.HelloServlet | | | | +> debug@5b09653==org.eclipse.jetty.embedded.DumpServlet,jsp=null,order=-1,inst=false,async=true - STARTED | | | | | +> class org.eclipse.jetty.embedded.DumpServlet -| | | | +> org.eclipse.jetty.servlet.DefaultServlet-59906517@ad9ec77f==org.eclipse.jetty.servlet.DefaultServlet,jsp=null,order=-1,inst=false,async=true - STARTED -| | | | +> class org.eclipse.jetty.servlet.DefaultServlet -| | | +> servletMappings ServletHandler@4206a205{STARTED} size=4 -| | | +> [/hello/*]=>org.eclipse.jetty.embedded.HelloServlet-42d8062c +| | | | +> org.eclipse.jetty.servlet.DefaultServlet-6b9651f3@8eb381d1==org.eclipse.jetty.servlet.DefaultServlet,jsp=null,order=-1,inst=true,async=true - STARTED +| | | | +> org.eclipse.jetty.servlet.DefaultServlet@78a2da20 +| | | +> servletMappings ServletHandler@516be40f{STARTED} size=4 +| | | +> [/hello/*]=>org.eclipse.jetty.embedded.HelloServlet-58c1670b | | | +> [/dump/*]=>debug | | | +> [*.dump]=>debug -| | | +> [/]=>org.eclipse.jetty.servlet.DefaultServlet-59906517 -| | += org.eclipse.jetty.server.session.DefaultSessionCache@2357d90a[evict=-1,removeUnloadable=false,saveOnCreate=false,saveOnInactiveEvict=false] - STARTED -| | | += org.eclipse.jetty.server.session.NullSessionDataStore@6328d34a[passivating=false,graceSec=3600] - STARTED -| | +~ DefaultSessionIdManager@145eaa29{STARTED}[worker=node0] - STARTED +| | | +> [/]=>org.eclipse.jetty.servlet.DefaultServlet-6b9651f3 +| | += org.eclipse.jetty.server.session.DefaultSessionCache@dd3b207[evict=-1,removeUnloadable=false,saveOnCreate=false,saveOnInactiveEvict=false] - STARTED +| | | += org.eclipse.jetty.server.session.NullSessionDataStore@551bdc27[passivating=false,graceSec=3600] - STARTED +| | +~ DefaultSessionIdManager@58fdd99{STARTED}[worker=node0] - STARTED | +> No ClassLoader -| +> eventListeners o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=2 -| | +> org.eclipse.jetty.embedded.OneServletContext$InitListener@15bb6bea -| | +> org.eclipse.jetty.embedded.OneServletContext$RequestListener@8b96fde -| +> handler attributes o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=1 -| | +> org.eclipse.jetty.server.Executor=QueuedThreadPool[qtp731260860]@2b9627bc{STARTED,8<=8<=10,i=5,r=1,q=0}[ReservedThreadExecutor@77e4c80f{s=0/1,p=0}] -| +> context attributes o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=2 +| +> eventListeners o.e.j.s.ServletContextHandler@3ffcd140{/,file:///tmp/,AVAILABLE} size=2 +| | +> org.eclipse.jetty.embedded.OneServletContext$InitListener@6b1274d2 +| | +> org.eclipse.jetty.embedded.OneServletContext$RequestListener@7bc1a03d +| +> handler attributes o.e.j.s.ServletContextHandler@3ffcd140{/,file:///tmp/,AVAILABLE} size=1 +| | +> org.eclipse.jetty.server.Executor=QueuedThreadPool[qtp488044861]@1d16f93d{STARTED,8<=8<=200,i=2,r=4,q=0}[ReservedThreadExecutor@16267862{s=2/4,p=0}] +| +> context attributes o.e.j.s.ServletContextHandler@3ffcd140{/,file:///tmp/,AVAILABLE} size=2 | | +> org.eclipse.jetty.util.DecoratedObjectFactory=org.eclipse.jetty.util.DecoratedObjectFactory[decorators=1] | | +> X-Init=true -| +> initparams o.e.j.s.ServletContextHandler@3444d69d{/,file:///tmp/,AVAILABLE} size=0 -+= ErrorHandler@4c40b76e{STARTED} - STARTED -+= DefaultSessionIdManager@145eaa29{STARTED}[worker=node0] - STARTED -| += HouseKeeper@dbd940d{STARTED}[interval=600000, ownscheduler=true] - STARTED +| +> initparams o.e.j.s.ServletContextHandler@3ffcd140{/,file:///tmp/,AVAILABLE} size=0 ++= ErrorHandler@ba8d91c{STARTED} - STARTED ++= DefaultSessionIdManager@58fdd99{STARTED}[worker=node0] - STARTED +| += HouseKeeper@60438a68{STARTED}[interval=660000, ownscheduler=true] - STARTED +> jdk.internal.loader.ClassLoaders$AppClassLoader@2c13da15 - +> jdk.internal.loader.ClassLoaders$PlatformClassLoader@2ea6137 + +> jdk.internal.loader.ClassLoaders$PlatformClassLoader@7364985f key: +- bean, += managed, +~ unmanaged, +? auto, +: iterable, +] array, +@ map, +> undefined .... 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 3629a1f2df19..cbc0ad23409e 100644 --- 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 @@ -704,11 +704,11 @@ public void dump(Appendable out, String indent) throws IOException for (Thread thread : _threads) { StackTraceElement[] trace = thread.getStackTrace(); - String known = getKnownMethod(trace); - String baseThreadInfo = String.format("%s %s %s %d", thread.getId(), thread.getName(), thread.getState(), thread.getPriority()); + String stackTag = getCompressedStackTag(trace); + String baseThreadInfo = String.format("%s %s tid=%d prio=%d", thread.getName(), thread.getState(), thread.getId(), thread.getPriority()); - if (!StringUtil.isBlank(known)) - threads.add(baseThreadInfo + " " + known); + if (!StringUtil.isBlank(stackTag)) + threads.add(baseThreadInfo + " " + stackTag); else if (isDetailedDump()) threads.add((Dumpable)(o, i) -> Dumpable.dumpObjects(o, i, baseThreadInfo, (Object[])trace)); else @@ -722,7 +722,7 @@ else if (isDetailedDump()) dumpObjects(out, indent, threadsDump); } - private String getKnownMethod(StackTraceElement[] trace) + private String getCompressedStackTag(StackTraceElement[] trace) { for (StackTraceElement t : trace) {