Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2ADB3200B7C for ; Thu, 25 Aug 2016 04:28:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 29A33160AC5; Thu, 25 Aug 2016 02:28:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 77EC4160AB1 for ; Thu, 25 Aug 2016 04:28:21 +0200 (CEST) Received: (qmail 33572 invoked by uid 500); 25 Aug 2016 02:28:20 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 33559 invoked by uid 99); 25 Aug 2016 02:28:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 02:28:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7C9862C0032 for ; Thu, 25 Aug 2016 02:28:20 +0000 (UTC) Date: Thu, 25 Aug 2016 02:28:20 +0000 (UTC) From: "jeho0815 (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DBCP-470) Create a new BasicDataSource, the database hasn't start, the DBCP's pool will be leaked MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 25 Aug 2016 02:28:22 -0000 [ https://issues.apache.org/jira/browse/DBCP-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15436144#comment-15436144 ] jeho0815 commented on DBCP-470: ------------------------------- Class Name Shallow Heap Retained Heap org.apache.commons.dbcp.PoolableConnection @ 0xad601d30 48 128 org.apache.commons.dbcp.PoolableConnection @ 0xad5f8110 48 128 org.apache.commons.dbcp.PoolableConnection @ 0xad5f2f40 48 128 org.apache.commons.dbcp.PoolableConnection @ 0xad5e0d00 48 128 there are 512 connections leak, if the server wait timeout is long, may cause denie of service! > Create a new BasicDataSource, the database hasn't start, the DBCP's pool will be leaked > --------------------------------------------------------------------------------------- > > Key: DBCP-470 > URL: https://issues.apache.org/jira/browse/DBCP-470 > Project: Commons Dbcp > Issue Type: Bug > Affects Versions: 1.4 > Environment: All environment > Reporter: jeho0815 > Labels: robustness, security > Fix For: 1.4.1 > > Original Estimate: 4h > Remaining Estimate: 4h > > First the database hasn't start, then create a new BasicDataSource. The method createDataSource judge dataSource == null, will create a new dataSource. The first step is create a connectionPool, second create a connectionFactory, but validateConnectionFactory will throw a SQLNestedException, the dataSource will be null again. Next itme repeat the steps again and again. The most import issue is create the connectionPool will be refered by a java.lang.Timer, so it can't be collected by GC. If the minIdle is positive, when database status is ok, it will create connection also. > As a word, the bug will cause memory leak and may cause connection leak. -- This message was sent by Atlassian JIRA (v6.3.4#6332)