Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 81717 invoked from network); 2 Jun 2009 19:55:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jun 2009 19:55:11 -0000 Received: (qmail 36053 invoked by uid 500); 2 Jun 2009 19:55:23 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 35930 invoked by uid 500); 2 Jun 2009 19:55:23 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 35920 invoked by uid 99); 2 Jun 2009 19:55:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 19:55:23 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [193.252.22.190] (HELO smtp6.freeserve.com) (193.252.22.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 19:55:12 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3629.me.freeserve.com (SMTP Server) with ESMTP id 9F2927000088 for ; Tue, 2 Jun 2009 21:54:51 +0200 (CEST) Received: from smtp.homeinbox.net (unknown [91.109.147.237]) by mwinf3629.me.freeserve.com (SMTP Server) with ESMTP id 6164A7000086 for ; Tue, 2 Jun 2009 21:54:51 +0200 (CEST) X-ME-UUID: 20090602195451399.6164A7000086@mwinf3629.me.freeserve.com Received: from localhost (localhost [127.0.0.1]) by smtp.homeinbox.net (Postfix) with ESMTP id C1EE81A40AE for ; Tue, 2 Jun 2009 20:54:49 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at homeinbox.net Received: from smtp.homeinbox.net ([127.0.0.1]) by localhost (server01.dev.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vzfT3aCvP70I for ; Tue, 2 Jun 2009 20:54:46 +0100 (BST) Received: from [192.168.0.9] (study03.dev.local [192.168.0.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.homeinbox.net (Postfix) with ESMTPSA id 431F31A4D09 for ; Tue, 2 Jun 2009 20:54:46 +0100 (BST) Message-ID: <4A25836C.9070302@apache.org> Date: Tue, 02 Jun 2009 20:54:20 +0100 From: Mark Thomas User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Commons Developers List Subject: Re: svn commit: r780905 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java References: <20090602020123.2EEBA23888BD@eris.apache.org> <4A251578.6060007@apache.org> <8a81b4af0906020535x503fe79av86ba113138b519cc@mail.gmail.com> <4A255BB0.8070805@apache.org> <8a81b4af0906021249o1e1c9144g22393599fd6e7b80@mail.gmail.com> In-Reply-To: <8a81b4af0906021249o1e1c9144g22393599fd6e7b80@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Phil Steitz wrote: > +1 thanks. > > Are you sure not clearing the queues, map and list on clear is OK? > Could this result in memory leaks in some apps? I am 99.9% sure that the queues map and list will all be clear at the end of the clear() method. At least, that was my intention. I'll re-check the code. If that isn't the case, I'd rather figure out where the new code is wrong than add a band-aid in case it ends up masking some other subtle issue. We might need to add some additional checks just while we complete the testing. Mark > > On 6/2/09, Mark Thomas wrote: >> Phil Steitz wrote: >>> Good catch. Yes, needs to by synched (and that could be tricky, with >>> destroy between). Looks to me like destroy destroys the pairs, but >>> does not clear the queues (prior to change) and clear clears _poolList >>> but not _poolMap. Could be I am wrong. I Will look at this some more >>> this eve. >> I did some more digging and I think r780905 needs to be reverted. >> >> The root cause is an issue you and Sebb had already identified - the >> eviction cursors are not reset on clear(). Stepping through the code >> what happens is that the first eviction attempts to destroy an object >> that has already been destroyed. This appears to succeed - hence why we >> end up one eviction short at the end of the test. >> >> I can reproduce the problem and clearing the eviction cursors as part fo >> clear appears to resolve the issue. I have tried (and failed) to add >> some tests for this. What I really want to do have the factory destroy() >> method throw an exception if you try to destroy the same object twice. >> Unfortunately, the pool implementations just swallow this exception. >> >> Logging (ie POOL 2.x) could be a solution to this. Another option is to >> remove the throws declaration from the factory destroy() method and >> leave it up to factory implementations to determine what exceptions are >> safe to be swallowed. That is a small, but very significant, API change >> that needs discussion come 2.x >> >> I'll revert r780905, add the fix described above and than re-review the >> dev archive and look at the other potential issues identified over the >> last few days. >> >> Mark >> >>> On 6/2/09, Mark Thomas wrote: >>>> psteitz@apache.org wrote: >>>>> Author: psteitz >>>>> Date: Tue Jun 2 02:01:22 2009 >>>>> New Revision: 780905 >>>>> >>>>> URL: http://svn.apache.org/viewvc?rev=780905&view=rev >>>>> Log: >>>>> Ensure that clear() fully clears the pool. >>>> >>>> >>>>> @@ -1293,6 +1293,7 @@ >>>>> } >>>>> } >>>>> destroy(toDestroy); >>>>> + _poolMap.clear(); >>>>> } >>>>> >>>>> /** >>>> Still working through the e-mails from over the weekend but on first >>>> inspection that _poolMap.clear() needs to be inside the sync block to >>>> keep it thread safe. Given that, I am having troubling seeing how the >>>> _poolMap isn't already empty at that point. I wonder if we got to the >>>> real root cause of the bug ...? >>>> >>>> I'll get set up to do some testing and report my findings. >>>> >>>> Mark >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>>> For additional commands, e-mail: dev-help@commons.apache.org >>>> >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org