tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtallen <gtal...@home.com>
Subject Tomcat Thread Pools
Date Sat, 15 Apr 2000 04:41:45 GMT
Hi,
I've been doing some testing of both the RC1 and the source
with the thread pools and have run into some problems and
questions (BTW: what a great piece of work Tomcat developers).


First, if I don't have a "Ajp12ConnectionHandler" connector defined then
I can't
shut Tomcat down since Tomcat uses this to handler to stop itself.  So,
I guess we
always must have this "Ajp12ConnectionHandler" handler defined?  It
appears to be
true based on my view of the source, is this intentional?


Second, are there minimum and maximum values for the max_threads,
max_spare_threads,
and min_spare_threads other than zero?  If I set them all to (1) then
Tomcat will not
start, do they need to be in any particular ratio.


Third, how robust is the "PoolTcpConnector" and has anyone used it
extensively?


Fourth, minor problem.
If I start Tomcat and then shut it down with
the following Connector definition:
=================================================================================
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="8007"/>
              <Parameter name="max_threads" value="30"/>
          <Parameter name="max_spare_threads" value="20"/>
          <Parameter name="min_spare_threads" value="5"/>
</Connector>
==================================================================================
I get:
Starting tcp endpoint on 8007 with
org.apache.tomcat.service.connector.Ajp12ConnectionHandler
java.lang.ArrayIndexOutOfBoundsException: 3 >= 3
Signal ignored: 15
HANDLER THREAD PROBLEM: java.lang.NullPointerException:
java.lang.NullPointerException:
        at
org.apache.tomcat.service.connector.AJP12ResponseAdapter.sendStatus(Ajp12ConnectionHandler.java:439)
        at
org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(HttpResponseAdapter.java,
Compiled Code)
        at
org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders(BufferedServletOutputStream.java:127)
        at
org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush(BufferedServletOutputStream.java:239)
        at
org.apache.tomcat.core.ResponseImpl.finish(ResponseImpl.java:178)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:158)
        at
org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java,
Compiled Code)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java:479)
=====================================================================================
Because "sout" is not checked for null in the following class
===================================================================================
class AJP12ResponseAdapter extends HttpResponseAdapter {
    /** Override setStatus
     */
    protected void sendStatus( int status, String message)  throws
IOException {
 statusSB.setLength(0);
 statusSB.append("Status: " ).append( status ).append("
").append(message).append("\r\n");
 if(sout == null)
  System.out.println("NULL stream=======================");
 sout.write(statusSB.toString().getBytes());
    }
}

Mime
View raw message