From dev-return-197152-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Tue Mar 5 05:08:16 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B9AE8180627 for ; Tue, 5 Mar 2019 06:08:15 +0100 (CET) Received: (qmail 62020 invoked by uid 500); 5 Mar 2019 05:08:14 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 62009 invoked by uid 99); 5 Mar 2019 05:08:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Mar 2019 05:08:14 +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 B4DD7C0078 for ; Tue, 5 Mar 2019 05:08:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -10.3 X-Spam-Level: X-Spam-Status: No, score=-10.3 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id O3x8-Ek2uaad for ; Tue, 5 Mar 2019 05:08:12 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1E20861115 for ; Tue, 5 Mar 2019 05:08:12 +0000 (UTC) Received: from bz-he-de.apache.org (bz-he-de.apache.org [148.251.237.210]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTPS id 6D247E0C57 for ; Tue, 5 Mar 2019 05:08:11 +0000 (UTC) Received: by bz-he-de.apache.org (ASF Mail Server at bz-he-de.apache.org, from userid 33) id 1E6406A0068; Tue, 5 Mar 2019 05:08:09 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 63210] Tomcat failing to shutdown if EvictionTimer thread is running Date: Tue, 05 Mar 2019 05:08:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 9 X-Bugzilla-Component: Catalina X-Bugzilla-Version: 9.0.x X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kirk@gameldar.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: ----- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://bz.apache.org/bugzilla/show_bug.cgi?id=3D63210 --- Comment #12 from kirk@gameldar.com --- (In reply to Mark Thomas from comment #10) > DBCP2 (actually Pool2) requires explicit shutdown and is documented as su= ch. > If it is shutdown (via closeMethod=3D"close") then the Evictor thread is > stopped. >=20 > My current thinking is to set closeMethod=3D"close" if we create a DataSo= urce > resource using the built-in factory and to do so in such as way that the > user can override it if they wish. I need to test this works as expected. I've just built and tested from the git repository source - the implementat= ion works as you have implemented - it shuts down correctly without the value s= et, and fails to shutdown if closeMethod=3D"" is used. It actually doesn't fix my use case but that is because we implement our own factory that returns the BasicDataSource. However it does point me to the correct solution, which is to set the closeMethod=3D"close" in my case (I t= hought I had tried this) - which already works with 9.0.16. I guess the only change that could make this more generic is to test the actualResource for implementing AutoClosable e.g. something like: Object actualResource =3D envCtx.lookup(resource.getName()); + if (!resource.isCloseMethodConfigured() && actualResource instanceof AutoCloseable) { + resource.setCloseMethod("close"); + } --=20 You are receiving this mail because: You are the assignee for the bug.= --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org