Re: tomcat - request thread pool question

2003-08-27 Thread Bill Barker
Pretty much what Yoav said ;).  If the servlet throws an exception out of
the service method, Tomcat can't be sure that the input stream was fully
read, so it doesn't know what the next data it's going to read is.  In the
case of an Exception, it is (usually) a clean shutdown (Tomcat sends a
'Connection: close', and returns the Thread to the pool).

Shapira, Yoav [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Howdy,
A typical pool implementation attempts to guarantee that poolable
objects handed out to clients are valid.  If an exception occurs in a
pool object it's a legitimate strategy to discard that object and create
a new valid one, so that a corrupt object will never be handed out to
applications.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Rau NF [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 3:58 PM
To: [EMAIL PROTECTED]
Subject: Re: tomcat - request thread pool question

Hi - I was referring to the HTTP 1.1 Connector. Thanks
for the information but I am a bit puzzled as to why
the threads should go away (ie die) on getting an
exception.   On a heavily loaded server, we can have
different IO exceptions being generated all the time
and the pool will be too busy trying creating new
threads. Not really  pool like behaviour ...thoughts
anyone ?

Thanks



It really depends on if you are talking about the HTTP
Connector, or
the AJP
Connector.

For the HTTP Connector, threads usually have short
lives (i.e. they
exit
after the last Keep-Alive has been handled).
Exceptions thrown out of
the
servlet, and certain HTTP status codes will also end
the thread (since
the
socket stream is likely in an undefined state in these
cases).

For the AJP Connector, threads usually have long
lives.  If you haven't
configured a connectionTimeout, then they usually last
as long as the
Apache
child that they are talking to does.  However, if they
get a
SocketException
on output, then it will exit early (since Apache isn't
talking to it
anymore).
=

--- Rau NF [EMAIL PROTECTED] wrote:
 Hi - Under what conditions can the tomcat thread
 pool
 implementation decide to let a thread exit ?

 Would this happen if some application code threw an
 exception and is caught only by the tomcat framework
 ?
 Can it happen if the servlet is writing data out to
 a
 connection and gets a SocketException or one of
 those
 IllegalStateExceptions ? eg.,

 2003-08-22 01:13:11 ApplicationDispatcher[]
 Servlet.service() for servlet jsp_servlet.some_jsp
 threw exception
 java.lang.IllegalStateException: Cannot create a
 session after the response has been committed
 at

org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java
:188
4)
 at

org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1
731)



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat - request thread pool question

2003-08-26 Thread Rau NF
Hi - I was referring to the HTTP 1.1 Connector. Thanks
for the information but I am a bit puzzled as to why
the threads should go away (ie die) on getting an
exception.   On a heavily loaded server, we can have
different IO exceptions being generated all the time
and the pool will be too busy trying creating new
threads. Not really  pool like behaviour ...thoughts
anyone ?

Thanks



It really depends on if you are talking about the HTTP
Connector, or 
the AJP
Connector.

For the HTTP Connector, threads usually have short
lives (i.e. they 
exit
after the last Keep-Alive has been handled). 
Exceptions thrown out of 
the
servlet, and certain HTTP status codes will also end
the thread (since 
the
socket stream is likely in an undefined state in these
cases).

For the AJP Connector, threads usually have long
lives.  If you haven't
configured a connectionTimeout, then they usually last
as long as the 
Apache
child that they are talking to does.  However, if they
get a 
SocketException
on output, then it will exit early (since Apache isn't
talking to it
anymore).
=

--- Rau NF [EMAIL PROTECTED] wrote:
 Hi - Under what conditions can the tomcat thread
 pool
 implementation decide to let a thread exit ? 
 
 Would this happen if some application code threw an
 exception and is caught only by the tomcat framework
 ?
 Can it happen if the servlet is writing data out to
 a
 connection and gets a SocketException or one of
 those
 IllegalStateExceptions ? eg.,
 
 2003-08-22 01:13:11 ApplicationDispatcher[]
 Servlet.service() for servlet jsp_servlet.some_jsp
 threw exception
 java.lang.IllegalStateException: Cannot create a
 session after the response has been committed
 at

org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884)
 at

org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)
 
 

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat - request thread pool question

2003-08-26 Thread Shapira, Yoav

Howdy,
A typical pool implementation attempts to guarantee that poolable
objects handed out to clients are valid.  If an exception occurs in a
pool object it's a legitimate strategy to discard that object and create
a new valid one, so that a corrupt object will never be handed out to
applications.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Rau NF [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 3:58 PM
To: [EMAIL PROTECTED]
Subject: Re: tomcat - request thread pool question

Hi - I was referring to the HTTP 1.1 Connector. Thanks
for the information but I am a bit puzzled as to why
the threads should go away (ie die) on getting an
exception.   On a heavily loaded server, we can have
different IO exceptions being generated all the time
and the pool will be too busy trying creating new
threads. Not really  pool like behaviour ...thoughts
anyone ?

Thanks



It really depends on if you are talking about the HTTP
Connector, or
the AJP
Connector.

For the HTTP Connector, threads usually have short
lives (i.e. they
exit
after the last Keep-Alive has been handled).
Exceptions thrown out of
the
servlet, and certain HTTP status codes will also end
the thread (since
the
socket stream is likely in an undefined state in these
cases).

For the AJP Connector, threads usually have long
lives.  If you haven't
configured a connectionTimeout, then they usually last
as long as the
Apache
child that they are talking to does.  However, if they
get a
SocketException
on output, then it will exit early (since Apache isn't
talking to it
anymore).
=

--- Rau NF [EMAIL PROTECTED] wrote:
 Hi - Under what conditions can the tomcat thread
 pool
 implementation decide to let a thread exit ?

 Would this happen if some application code threw an
 exception and is caught only by the tomcat framework
 ?
 Can it happen if the servlet is writing data out to
 a
 connection and gets a SocketException or one of
 those
 IllegalStateExceptions ? eg.,

 2003-08-22 01:13:11 ApplicationDispatcher[]
 Servlet.service() for servlet jsp_servlet.some_jsp
 threw exception
 java.lang.IllegalStateException: Cannot create a
 session after the response has been committed
 at

org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java
:188
4)
 at

org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1
731)



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tomcat - request thread pool question

2003-08-22 Thread Rau NF
Hi - Under what conditions can the tomcat thread pool
implementation decide to let a thread exit ? 

Would this happen if some application code threw an
exception and is caught only by the tomcat framework ?
Can it happen if the servlet is writing data out to a
connection and gets a SocketException or one of those
IllegalStateExceptions ? eg.,

2003-08-22 01:13:11 ApplicationDispatcher[]
Servlet.service() for servlet jsp_servlet.some_jsp
threw exception
java.lang.IllegalStateException: Cannot create a
session after the response has been committed
at
org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884)
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)


Thanks
Rau


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat - request thread pool question

2003-08-22 Thread Bill Barker
It really depends on if you are talking about the HTTP Connector, or the AJP
Connector.

For the HTTP Connector, threads usually have short lives (i.e. they exit
after the last Keep-Alive has been handled).  Exceptions thrown out of the
servlet, and certain HTTP status codes will also end the thread (since the
socket stream is likely in an undefined state in these cases).

For the AJP Connector, threads usually have long lives.  If you haven't
configured a connectionTimeout, then they usually last as long as the Apache
child that they are talking to does.  However, if they get a SocketException
on output, then it will exit early (since Apache isn't talking to it
anymore).

Rau NF [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi - Under what conditions can the tomcat thread pool
 implementation decide to let a thread exit ?

 Would this happen if some application code threw an
 exception and is caught only by the tomcat framework ?
 Can it happen if the servlet is writing data out to a
 connection and gets a SocketException or one of those
 IllegalStateExceptions ? eg.,

 2003-08-22 01:13:11 ApplicationDispatcher[]
 Servlet.service() for servlet jsp_servlet.some_jsp
 threw exception
 java.lang.IllegalStateException: Cannot create a
 session after the response has been committed
 at

org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884
)
 at

org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)


 Thanks
 Rau


 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]