Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 48982 invoked from network); 12 Nov 2007 18:04:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Nov 2007 18:04:42 -0000 Received: (qmail 42856 invoked by uid 500); 12 Nov 2007 18:04:17 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 42757 invoked by uid 500); 12 Nov 2007 18:04:16 -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 42718 invoked by uid 99); 12 Nov 2007 18:04:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2007 10:04:16 -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, 12 Nov 2007 18:04:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 11128714231 for ; Mon, 12 Nov 2007 10:04:07 -0800 (PST) Message-ID: <1499402.1194890647042.JavaMail.jira@brutus> Date: Mon, 12 Nov 2007 10:04:07 -0800 (PST) From: "Matthew Moore (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (POOL-108) GenericObjectPool does per-resource work (e.g. validate) in a synchronized context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org GenericObjectPool does per-resource work (e.g. validate) in a synchronized context ---------------------------------------------------------------------------------- Key: POOL-108 URL: https://issues.apache.org/jira/browse/POOL-108 Project: Commons Pool Issue Type: Improvement Affects Versions: 1.3 Reporter: Matthew Moore While using the pool library with DBCP, and load testing with simulated failures, we noticed that a single bad connection can cause multiple threads to block when the test on borrow flag is true. (Using "select 1" as a test query.) Looking at the code, GenericObjectPool performs activation, passivation, and validate on both borrow and return, inside of synchronized methods. This can be a real problem, since any of these operations could conceivably block, in which case all threads trying to obtain or release a resource will also block for the duration. Some of these concerns are indirectly covered by POOL-93 in 2.0. Looking at revision 594226 I can see this has not yet been addressed. Narrowing the synchronization scope via synchronized blocks, rather than synchronizing the entire method, would deal with this easily enough. If I get the time I'll work up a patch. This should be addressed - in the context of DBCP it turns test on return / borrow into counter-intuitively dangerous options. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.