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 3988318EFE for ; Mon, 5 Oct 2015 06:55:02 +0000 (UTC) Received: (qmail 18827 invoked by uid 500); 5 Oct 2015 06:54:58 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 18755 invoked by uid 500); 5 Oct 2015 06:54:58 -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 18743 invoked by uid 99); 5 Oct 2015 06:54:58 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2015 06:54:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D9B8DC2798 for ; Mon, 5 Oct 2015 06:54:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id sH5UzL3egTDs for ; Mon, 5 Oct 2015 06:54:50 +0000 (UTC) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id EB7AF23038 for ; Mon, 5 Oct 2015 06:54:49 +0000 (UTC) Received: by obcgx8 with SMTP id gx8so121498505obc.3 for ; Sun, 04 Oct 2015 23:54:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=s7L729xk3MF2VoY8I+ujgNU51V3a2Xj7yEuF0ouH9/A=; b=IoFToG8Z995F6yINiri46DKgUTOgfltt+WZPIgKPnCN7ljHi0Q5mBdMvlseHwJyMsE xjoXs0Jy/vR3pEd3kRKG0Gg/lMzoudoBzNNg5wBpSnWzPu60MM89cYvyk+wV4yu0B9TM Z/QAsi+hs4nV0EIkmUErP8TiiXMDelqv/qe8nT0UsA5Ym0YSJNvDmnLZgsWcoapYTqub Kb4v5htHzGQsisKKOknJPAQwb/6qFx8m7zaA4axgk5Cj6DI0+s3gK9jYiXKV5+8bs4jG JVY6du3Ik+pjAMSk68L1Lc+SFLWte+eKAF1CkKzrNgwAmAuMwkHZijQ9cKAoJzna+pfs 73aA== X-Gm-Message-State: ALoCoQlCVdYBYsg7dsxBV0/faNhc1DoHgmHPQUV08s2EqOg1o2/H4jf/YiYsPZ5xPb/nSZ7T5NA1 MIME-Version: 1.0 X-Received: by 10.182.144.233 with SMTP id sp9mr17179417obb.9.1444028089370; Sun, 04 Oct 2015 23:54:49 -0700 (PDT) Received: by 10.202.10.82 with HTTP; Sun, 4 Oct 2015 23:54:49 -0700 (PDT) Date: Mon, 5 Oct 2015 12:24:49 +0530 Message-ID: Subject: Regarding StuckThreadDetectionValve From: Yogesh Patel To: users@tomcat.apache.org Cc: Collaborate Project Managers Content-Type: multipart/alternative; boundary=089e0153695050282d052155fd72 --089e0153695050282d052155fd72 Content-Type: text/plain; charset=UTF-8 We are facing issues with long running thread in tomcat . we are using Tomcat-7.0.47.Tomcat manager shows Current busy threads : 200, application gets stucked due to these long running threads. We implemented StuckThreadDetectionValve in server.xml( ), but it could not help out. So we implemented custom StuckThreadDetectionValve by extending StuckThreadDetectionValve from catalina, it only goes to "constructor","initInternal",and in "invoke"(when action fires), it does not go to function "getStuckThreadNames()" even after threshold time.How to achieve the same.Is there any way to detect stucked thread and kill them? My custom Valve is like following : public class StuckThreadDetection extends StuckThreadDetectionValve { StuckThreadDetection stuckThreadDetection; public StuckThreadDetection() { System.out.println("in StuckThreadDetection constructor"); } public void invoke(Request request, Response response) throws IOException, ServletException { System.out.println("in invoke..."); getNext().invoke(request, response); } @Override protected void initInternal() throws LifecycleException { System.out.println("In initInternal"); super.initInternal(); } @Override public String[] getStuckThreadNames() { System.out.println("in getStuckThreadNames..."); String[] listStuckedThread = this.getStuckThreadNames(); for (String threadName : listStuckedThread) { System.out.println(threadName); } return listStuckedThread; } @Override public String getInfo() { System.out.println("In getInfo"); return super.getInfo(); } } -- *Thanks & Regards,* * Yogesh Patel* --089e0153695050282d052155fd72--