Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5539269BE for ; Sat, 11 Jun 2011 15:11:52 +0000 (UTC) Received: (qmail 74574 invoked by uid 500); 11 Jun 2011 15:11:48 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 74519 invoked by uid 500); 11 Jun 2011 15:11:48 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 74510 invoked by uid 99); 11 Jun 2011 15:11:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jun 2011 15:11:48 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jun 2011 15:11:43 +0000 Received: from [192.168.2.101] ([192.168.2.101]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id p5BFBKM9006083 for ; Sat, 11 Jun 2011 17:11:21 +0200 (CEST) Message-ID: <4DF38598.3010702@kippdata.de> Date: Sat, 11 Jun 2011 17:11:20 +0200 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Terminating long running request threads References: <99C8B2929B39C24493377AC7A121E21FAFF0860FA2@USEA-EXCH8.na.uis.unisys.com> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit On 11.06.2011 09:30, Afkham Azeez wrote: > Folks, > Is there any API to get hold of Tomcat's Connector thread pools? Each request is registered with an MBean in the MBeanServer. As long as the request is running, the MBean contains additional info, like the URI, when the request started, the thread name etc. This gives you enough info to find long running requests and to find the thread. But there's no non-deprecated Java API known to have no side effects to terminate a thread. If it were (or you find one), we had to check how the thread pool behaves w.r.t. "vanishing" threads. Regards, Rainer > On Thu, Jun 9, 2011 at 10:58 PM, Afkham Azeez wrote: > >> >> >> On Thu, Jun 9, 2011 at 10:51 PM, Caldarale, Charles R < >> Chuck.Caldarale@unisys.com> wrote: >> >>>> From: Afkham Azeez [mailto:afkham@gmail.com] >>>> 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. >> >> Thanks >> Azeez --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org