Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 3157 invoked by uid 500); 2 Jul 2001 14:30:42 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 3120 invoked from network); 2 Jul 2001 14:30:39 -0000 Received: from web13402.mail.yahoo.com (216.136.175.60) by h31.sny.collab.net with SMTP; 2 Jul 2001 14:30:39 -0000 Message-ID: <20010702143040.80662.qmail@web13402.mail.yahoo.com> Received: from [200.192.44.197] by web13402.mail.yahoo.com; Mon, 02 Jul 2001 07:30:40 PDT Date: Mon, 2 Jul 2001 07:30:40 -0700 (PDT) From: Renato Weiner Subject: RE: Killing endless loop servlet - howto ? killing JVM or unload class ? To: tomcat-user@jakarta.apache.org In-Reply-To: <635802DA64D4D31190D500508B9B0410F99421@dcsrv0> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-846930886-994084240=:80492" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N --0-846930886-994084240=:80492 Content-Type: text/plain; charset=us-ascii > OK, no one's answered this yet, so,... >> First, I don't know if it's killing a thread is the right approach. Should I do that, without shutdown Tomcat ? > So, why are you creating an infinite loop? I mean, if you didn't, you wouldn't have to kill it. The problem is my environment. Since this is a webhosting, I cannot control what my users do. I'm 100% sure that they will create code that will run forever. I need to find a way to avoid this. > If you're generally asking how one can kill threads in Java, you could use java.lang.Thread.stop() (but read the deprecation warning). But as a rule, not creating infinite loops is a much better strategy. >> Is there a way to set a 'time-out' for a Servlet ? > Not the way you mean. You can set a timeout for a session (by modifying your web.xml); but AFAIK, the only way to set a timeout for a request would be on your browser. What about a patch for PoolTcpConnector ? Anyone ? Thanks ! -----Original Message----- From: Renato Weiner [mailto:reweiner@yahoo.com] Sent: Monday, July 02, 2001 6:03 AM To: tomcat-user@jakarta.apache.org Subject: Killing endless loop servlet - howto ? killing JVM or unload class ? Hi all, I'm rolling out a successful Tomcat instalation in a shared environment ( it's a great software ! ). But I have a concern. I created a servlet that loops forever ( a very stupid one, by the way ). When I executed it, it allocates a Tomcat thread and it just runs forever. If I try to kill it after it consumed, let's say, 30 seconds of processing, it ended up killing the whole JVM. First, I don't know if it's killing a thread is the right approach. Should I do that, without shutdown Tomcat ? Is there a way to set a 'time-out' for a Servlet ? What I can doin this situation ? Is there an Interceptor that can unload this class somehow ? Thanks in advance Renato - Brazil P.S. I'm running Linux, kernel 2.4.3, Tomcat 3.2.2 Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ --------------------------------- Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ --0-846930886-994084240=:80492 Content-Type: text/html; charset=us-ascii

> OK, no one's answered this yet, so,...

>> First, I don't know if it's killing a thread is the right approach. Should I do that, without shutdown Tomcat ?

> So, why are you creating an infinite loop? I mean, if you didn't, you wouldn't have to kill it.

The problem is my environment. Since this is a webhosting, I cannot control what my users do. I'm 100% sure that they will create code that will run forever. I need to find a way to avoid this.

> If you're generally asking how one can kill threads in Java, you could use java.lang.Thread.stop() (but read the deprecation warning). But as a rule, not creating infinite loops is a much better strategy.

>> Is there a way to set a 'time-out' for a Servlet ?

> Not the way you mean. You can set a timeout for a session (by modifying your web.xml); but AFAIK, the only way to set a timeout for a request would be on your browser.

What about a patch for PoolTcpConnector ? Anyone ?

Thanks !
-----Original Message-----
From: Renato Weiner [mailto:reweiner@yahoo.com]
Sent: Monday, July 02, 2001 6:03 AM
To: tomcat-user@jakarta.apache.org
Subject: Killing endless loop servlet - howto ? killing JVM or unload class
?


Hi all,
I'm rolling out a successful Tomcat instalation in a shared environment (
it's a great software ! ). But I have a concern.
I created a servlet that loops forever ( a very stupid one, by the way ).
When I executed it, it allocates a Tomcat thread and it just runs forever.
If I try to kill it after it consumed, let's say, 30 seconds of processing,
it ended up killing the whole JVM.
First, I don't know if it's killing a thread is the right approach. Should I
do that, without shutdown Tomcat ? Is there a way to set a 'time-out' for a
Servlet ? What I can doin this situation ? Is there an Interceptor that can
unload this class somehow ?
Thanks in advance
Renato - Brazil
P.S. I'm running Linux, kernel 2.4.3, Tomcat 3.2.2




Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 a year!
http://personal.mail.yahoo.com/



Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 a year!
http://personal.mail.yahoo.com/ --0-846930886-994084240=:80492--