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 45941622C for ; Sat, 11 Jun 2011 07:31:49 +0000 (UTC) Received: (qmail 53019 invoked by uid 500); 11 Jun 2011 07:31:45 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 52807 invoked by uid 500); 11 Jun 2011 07:31:45 -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 52685 invoked by uid 99); 11 Jun 2011 07:31:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jun 2011 07:31:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of afkham@gmail.com designates 209.85.213.173 as permitted sender) Received: from [209.85.213.173] (HELO mail-yx0-f173.google.com) (209.85.213.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jun 2011 07:31:37 +0000 Received: by yxn22 with SMTP id 22so514468yxn.18 for ; Sat, 11 Jun 2011 00:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=u4lE1eMF65iDsgm5yAe7YZGAJ43PitI2KShWmo004tc=; b=p3ghWXHawGMYkLFdR1OnpzQsrHeIYPCRG/HjsPF3qZj3Dzzj042QKdAWp/oYSex4J4 bqJfRKqFW68lRhWwGKYzvfreyYtQkwDUDRdZ3nl7GvyNLwgrARbR2CsIJL3X/bABKZGm fL2Z5tJy46rxZelgXBzdf9TJ167Oux+fiT0iE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gorjqCOz/46+rmhUGw3jylTNijGBRalnhb91bl7T/F98u50P5VCuWDobxGj/k0dVJe j2MYOnvbcj90ricSvZHafE5xEaNCGGhDjDo9Tw442QFXRE7w2mlCa8W2yEQB+s3dQZAP QcfZZZkLytVaDYmAFgyexyke6DPIRm4MT5DrQ= Received: by 10.236.76.193 with SMTP id b41mr3612015yhe.71.1307777476277; Sat, 11 Jun 2011 00:31:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.202.41 with HTTP; Sat, 11 Jun 2011 00:30:56 -0700 (PDT) In-Reply-To: References: <99C8B2929B39C24493377AC7A121E21FAFF0860FA2@USEA-EXCH8.na.uis.unisys.com> From: Afkham Azeez Date: Sat, 11 Jun 2011 13:00:56 +0530 Message-ID: Subject: Re: Terminating long running request threads To: Tomcat Users List Content-Type: multipart/alternative; boundary=20cf300facb9eb364a04a56aabd2 X-Virus-Checked: Checked by ClamAV on apache.org --20cf300facb9eb364a04a56aabd2 Content-Type: text/plain; charset=ISO-8859-1 Folks, Is there any API to get hold of Tomcat's Connector thread pools? Regards Azeez 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 > --20cf300facb9eb364a04a56aabd2--