Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 21426 invoked from network); 4 Feb 2008 08:27:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2008 08:27:31 -0000 Received: (qmail 75310 invoked by uid 500); 4 Feb 2008 08:27:21 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 75209 invoked by uid 500); 4 Feb 2008 08:27:21 -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 75197 invoked by uid 99); 4 Feb 2008 08:27:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 00:27:21 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 08:27:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 86E0A714071 for ; Mon, 4 Feb 2008 00:27:08 -0800 (PST) Message-ID: <19792933.1202113628532.JavaMail.jira@brutus> Date: Mon, 4 Feb 2008 00:27:08 -0800 (PST) From: "Meir Shahar (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (DBCP-260) borrowObject from the AbandonedObjectPool hangs on a wait() method when the WHEN_EXHAUSTED_BLOCK is set In-Reply-To: <28097771.1202052728178.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBCP-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565286#action_12565286 ] Meir Shahar commented on DBCP-260: ---------------------------------- Hi Phil, I use DBCP 1.2.2. You got it correctly and it is a corner condition, this would obviously not happen if a periodical cleaner thread would remove idle connections. As far as I am concerned, the workaround is fine. I submitted the bug to raise the issue and point at the location of the problem. If you decide to keep things as they are, at least other users can be aware of this issue. Also, the third faq item on the wiki page (http://wiki.apache.org/jakarta-commons/DBCP) states that the abandoned pool, though deprecated, is still active and will be supported in future versions. > borrowObject from the AbandonedObjectPool hangs on a wait() method when the WHEN_EXHAUSTED_BLOCK is set > ------------------------------------------------------------------------------------------------------- > > Key: DBCP-260 > URL: https://issues.apache.org/jira/browse/DBCP-260 > Project: Commons Dbcp > Issue Type: Improvement > Affects Versions: 1.2, 1.2.1, 1.2.2 > Environment: Windows XP, eclipse. JDK 1.6 > Reporter: Meir Shahar > Priority: Minor > > This bug is related to bugs #1, #38 & #102. Thought the bugs are closed, I think there is a (edge condition) scenario that is not handled properly: > Config: > 10 active connections limit > RemoveAbandoned set to 'on' > RemoveAbandonedTimeout set to x (say 60 secs) > Suppose 10 connections were borrowed and the 11 th request was issued, all within a time frame shorted then the timeout. > The first 10 requests are in methods that do not properly release the connection. > This means that the 11 th thread is waiting indefinitely until a notify is sent. > The 'non releasing' threads the first 10 connections hence no notification is sent > The 'garbage collection' is performed by the calling AbandonedObjectPool before calling the GenericObjectPool.borrowObject(...). This garbage collection will not be called again and the wait() will stay locked though some connections might be come available through timeout expiration. > The quick n dirty workaround is to setMaxWait(...) but still I think a better solution will be along the lines of: > 1. Waiting for removeAbandonedTimeout secs > 2. Retry regular allocation -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.