Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-08-26 22:40:54 -0400
committerGreg Wilkins2014-08-26 22:40:54 -0400
commit1a0eb64a1fabccd6d4b2990e1a6864db6ac2019b (patch)
treeb088f3624dde6d485b112c56ff1bf597ce287fc3 /jetty-server
parent9a52d92f036e5acfb41aead5bd4bd79ed37cb7ef (diff)
downloadorg.eclipse.jetty.project-1a0eb64a1fabccd6d4b2990e1a6864db6ac2019b.tar.gz
org.eclipse.jetty.project-1a0eb64a1fabccd6d4b2990e1a6864db6ac2019b.tar.xz
org.eclipse.jetty.project-1a0eb64a1fabccd6d4b2990e1a6864db6ac2019b.zip
442383 Improved insufficient threads message
Diffstat (limited to 'jetty-server')
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/Server.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
index 38cea332fb..b2ac61491f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
@@ -331,20 +331,23 @@ public class Server extends HandlerWrapper implements Attributes
// check size of thread pool
SizedThreadPool pool = getBean(SizedThreadPool.class);
int max=pool==null?-1:pool.getMaxThreads();
- int needed=1;
+ int selectors=0;
+ int acceptors=0;
if (mex.size()==0)
{
for (Connector connector : _connectors)
{
if (connector instanceof AbstractConnector)
- needed+=((AbstractConnector)connector).getAcceptors();
+ acceptors+=((AbstractConnector)connector).getAcceptors();
+
if (connector instanceof ServerConnector)
- needed+=((ServerConnector)connector).getSelectorManager().getSelectorCount();
+ selectors+=((ServerConnector)connector).getSelectorManager().getSelectorCount();
}
}
+ int needed=1+selectors+acceptors;
if (max>0 && needed>max)
- throw new IllegalStateException("Insufficient max threads in ThreadPool: max="+max+" < needed="+needed);
+ throw new IllegalStateException(String.format("Insufficient threads: max=%d < needed(acceptors=%d + selectors=%d + request=1)",max,acceptors,selectors));
try
{

Back to the top