[PATCH][JK] Ajp13Processor connection leak prevention
Adjusted Ajp13Processor's run() method to protect against unexpected unchecked excpetions, preventing the possibility of a leak in Ajp13Connector's request processor pool. Index: Ajp13Processor.java === RCS file: /home/cvspublic/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Processor.java,v retrieving revision 1.9 diff -u -u -r1.9 Ajp13Processor.java --- Ajp13Processor.java 7 Jun 2002 18:54:21 - 1.9 +++ Ajp13Processor.java 6 Nov 2002 08:01:14 - @@ -547,14 +547,16 @@ logger.log(socket assigned.); } - // Process the request from this socket - process(socket); - - // Finish up this request -if (debug 0) { -logger.log(recycling myself ...); +try { +// Process the request from this socket +process(socket); +} finally { +// Finish up this request +if (debug 0) { +logger.log(recycling myself ...); +} +connector.recycle(this); } - connector.recycle(this); } // Tell threadStop() we have shut ourselves down successfully On another note, what's the most robust Java and Apache httpd connector code bases these days for Tomcat 4.1? Not trying to start a religious war -- interested in your opinions. Please send me to the appropriate docs if this is a RTFM question. Thanks! -- Daniel Rall [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
lots of tomcat processes (Re: [PATCH][JK] Ajp13Processor connection leak prevention)
On Wed, Nov 06, 2002 at 12:10:09AM -0800, Daniel Rall wrote: Adjusted Ajp13Processor's run() method to protect against unexpected unchecked excpetions, preventing the possibility of a leak in Ajp13Connector's request processor pool. [ patch elided ] Would this cause hanging tomcat instances? I get a multiplying lot of tomcat processes after a while. How many should there be? Just one? i.e., is a 'request processor' a java thread or an OS process? Using apache1.3.27, mod_jk1.2.0, tomcat 4.0.4 (soon to be 4.0.6) on Solaris8. Regards, Matt -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
Re: lots of tomcat processes (Re: [PATCH][JK] Ajp13Processor connection leak prevention)
On Wed, Nov 06, 2002 at 02:01:42PM -0800, Daniel Rall wrote: I get a multiplying lot of tomcat processes after a while. How many should there be? This probably depends on your OS/JVM's threading model. On Linux, this is perfectly normal. Just one? i.e., is a 'request processor' a java thread or an OS process? A request processor is a Java thread, the implementation of which is OS-specific, varying depending upon your platform. I'm fairly sure that Solaris uses exactly one process consisting of multiple threads. I checked one of the processes with ps -L -p pid and it showed 9 lightweith processes in that one unix process. It looks like all but one of the Unix processes is rogue. Now to find out which one ... I'll try your patch and try and let you know how it goes. Thanks for your reply Daniel! Regards, Matt -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org