You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by eric scroger <es...@carl.org> on 2002/11/26 19:29:28 UTC

Ajp13Connector createProcessor() bug?

Greetings,

We were noticing some 'No processor available' exceptions
associated with the Ajp13Connectors under heavy load.
I downloaded the Tomcat 4.0.6 connectors source and had
a look at the code responsible for creating a new processor to
handle an incoming Ajp13 socket connection from Apache. 

In org.apache.ajp.tomcat4.Ajp13Connector.java, in the
createProcessor() method, I noticed that there was no logic
to handle the case if maxProcessors was configured to "-1"
for infinite processors.  In the HttpConnector source, if
maxProcessors was "-1", then it returned a newProcessor().
I modified this createProcessor() method to function in the
same manner and the Ajp13 "No processor available"
exceptions disappeared.

   private Ajp13Processor createProcessor() {

   synchronized (processors) {
       if (processors.size() > 0)
           return ((Ajp13Processor) processors.pop());
       if ((maxProcessors > 0) && (curProcessors < maxProcessors))
           return (newProcessor());
       else {
           if ((maxProcessors < 0))        // my new code returns a new 
processor
               return (newProcessor());    // if maxProcessors is "-1", 
aka infinite.
          else                       return 
(null);                       // original else return result
       }
   }
}

My question then, is this a bug in the Ajp13Connector functionality?
Or is there some design reason to not allow the user to configure
the Ajp13Connector for infinite processors via the "-1" option.
I couldn't locate any documentation that says Ajp13 connectors
cannot and should not be configured for infinite processors.

Thanks,

Eric Scroger




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Error? org/apache/ajp/tomcat4/Ajp13Connector createProcessor()

Posted by eric scroger <es...@carl.org>.
Greetings,

We were noticing some 'No processor available' exceptions
associated with the Ajp13Connectors under heavy load.
I downloaded the Tomcat 4.0.6 connectors source and had
a look at the code responsible for creating a new processor to
handle an incoming Ajp13 socket connection from Apache.

In org.apache.ajp.tomcat4.Ajp13Connector.java, in the
createProcessor() method, I noticed that there was no logic
to handle the case if maxProcessors was configured to "-1"
for infinite processors.  In the HttpConnector source, if
maxProcessors was "-1", then it returned a newProcessor().
I modified this createProcessor() method to function in the
same manner and the Ajp13 "No processor available"
exceptions disappeared.

  private Ajp13Processor createProcessor() {

  synchronized (processors) {
      if (processors.size() > 0)
          return ((Ajp13Processor) processors.pop());
      if ((maxProcessors > 0) && (curProcessors < maxProcessors))
          return (newProcessor());
      else {
          if ((maxProcessors < 0))        // my new code returns a new 
processor
              return (newProcessor());    // if maxProcessors is "-1", 
aka infinite.
         else                       return (null);                       
// original else return result
      }
  }
}

My question then, is this a bug in the Ajp13Connector functionality?
Or is there some design reason to not allow the user to configure
the Ajp13Connector for infinite processors via the "-1" option.
I couldn't locate any documentation that says Ajp13 connectors
cannot and should not be configured for infinite processors.

Thanks,

Eric Scroger





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>