tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Afkham Azeez <>
Subject Re: Terminating long running request threads
Date Thu, 09 Jun 2011 17:28:51 GMT
On Thu, Jun 9, 2011 at 10:51 PM, Caldarale, Charles R <> wrote:

> > From: Afkham Azeez []
> > Subject: Terminating long running request threads
> > is there a way to get hold of these long running threads
> > & terminate them?
> This is not an issue specific to Tomcat; there is no way to safely
> terminate a Java thread without the cooperation of that thread.  Best if you
> can code your webapp so that your request processors periodically check if
> they've been running too long and give up if so.

Yes, it is not a Tomcat specific issue. The thing is, we don't have total
control over what type of webapps will be deployed. We do restrict certain
operations using a Java Security Manager, but I do not think we can restrict
the running time of a Thread using a security manager. Using
the ThreadMXBean we can monitor the time each thread takes, and get the
thread IDs of long running threads. It may be possible to get that thread to
terminate if we have some support for that from the Tomcat threadpool. Just
thinking out loud.


>  - Chuck
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message