diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java index 43d154034a7..1539b020f5d 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java @@ -149,8 +149,8 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* ------------------------------------------------------------ */ /** - * Called when a dispatched thread is no longer handling the endpoint. The selection key - * operations are updated. + * Called when a dispatched thread is no longer handling the endpoint. + * The selection key operations are updated. */ protected boolean undispatch() { @@ -413,7 +413,6 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, */ public void run() { - boolean dispatched=true; do { @@ -475,11 +474,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* ------------------------------------------------------------ */ public String toString() { - return "SCEP@" + hashCode() + "[d=" + _dispatched + ",io=" + - ((SelectionKey.OP_ACCEPT&_interestOps)!=0?"A":"")+ - ((SelectionKey.OP_CONNECT&_interestOps)!=0?"C":"")+ - ((SelectionKey.OP_READ&_interestOps)!=0?"R":"")+ - ((SelectionKey.OP_WRITE&_interestOps)!=0?"W":"")+ + return "SCEP@" + hashCode() + "\t[d=" + _dispatched + ",io=" + _interestOps+ ",w=" + _writable + ",b=" + _readBlocked + "|" + _writeBlocked + "]"; } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java index efcdc11af0c..a4e47f18551 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java @@ -306,6 +306,7 @@ public class StressTest extends TestCase if (same++>10) { System.err.println("STALLED!!!"); + System.err.println(_server.getThreadPool().toString()); ((SelectChannelConnector)(_server.getConnectors()[0])).dump(); Thread.sleep(5000); System.exit(1); 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 9b2a81beb11..4cd23d80640 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 @@ -386,6 +386,12 @@ public class QueuedThreadPool extends AbstractLifeCycle implements ThreadPool, E { return new Thread(runnable); } + + /* ------------------------------------------------------------ */ + public String toString() + { + return _name+"{"+getMinThreads()+"<="+getIdleThreads()+"<="+getThreads()+"/"+getMaxThreads()+"}"; + } /* ------------------------------------------------------------ */ private Runnable _runnable = new Runnable()