Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 90332 invoked from network); 21 Mar 2008 16:05:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Mar 2008 16:05:24 -0000 Received: (qmail 29187 invoked by uid 500); 21 Mar 2008 16:05:22 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 28754 invoked by uid 500); 21 Mar 2008 16:05:20 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 28743 invoked by uid 99); 21 Mar 2008 16:05:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Mar 2008 09:05:20 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Mar 2008 16:04:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ADA03234C0A9 for ; Fri, 21 Mar 2008 09:03:24 -0700 (PDT) Message-ID: <1756440992.1206115404710.JavaMail.jira@brutus> Date: Fri, 21 Mar 2008 09:03:24 -0700 (PDT) From: "Grzegorz Kossakowski (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Closed: (COCOON-2070) Releasing of pooled beans might skip recycle() call on aggregated beans (leading to: "Generator already set"-style exceptions) In-Reply-To: <8053308.1180449915585.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/COCOON-2070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Grzegorz Kossakowski closed COCOON-2070. ---------------------------------------- Resolution: Fixed Affects version (Component): Parent values: Components: Sitemap(10152). Level 1 values: 1.0.0-RC3-dev(10312). Fix version (Component): Parent values: Components: Sitemap(10229). Level 1 values: 1.0.0-RC3-dev(10306). Fixed *definitively* in r639686. Thanks again Alexander for your patch! > Releasing of pooled beans might skip recycle() call on aggregated beans (leading to: "Generator already set"-style exceptions) > ------------------------------------------------------------------------------------------------------------------------------ > > Key: COCOON-2070 > URL: https://issues.apache.org/jira/browse/COCOON-2070 > Project: Cocoon > Issue Type: Bug > Components: - Components: Sitemap > Affects Versions: 2.2-dev (Current SVN) > Reporter: Alexander Klimetschek > Assignee: Grzegorz Kossakowski > Priority: Blocker > Fix For: 2.2-dev (Current SVN) > > Attachments: poolable-recycle-bug.patch > > > There is a serious bug in o.a.c.core.container.spring.avalon.PoolableProxyHandler (and PoolableFactoryBean) that can lead to exceptions like "Cannot set reader. Generator already set". This is because the pipeline impl bean is reused from the pool, but was never recycle()d. The recycle() call is skipped in cases when an exception is thrown by Spring inside PoolableProxyHandler.invoke("putBackIntoAvalonPool") - this exception is simply swalled by both PoolableProxyHandler.run() and PoolableFactoryBean.putIntoPool(). > The typical behaviour is that the first call to the pipeline works, but because the components are put back into the pool unrecycled, the next call will fail. If there is lots of activity, you might get a fresh component from the pool and it might work again, so the error seems quite random. > The problematic exception happens when RequestContextHolder.currentRequestAttributes() is called when the attributes for the request are null: IllegalStateException("No thread-bound request found:....."). The call to that method happens in the "putBackIntoAvalonPool" case in PoolableProxyHandler.invoke(). The problem is that this code will also be called *after* the request attributes were set to null by the RequestContextListener, because it is registered as a destruction callback, that gets called by Spring after the attribute reset. > The real chain of calls is as follows: > RequestContextListener.requestDestroyed() > RequestContextHolder.setRequestAttributes(null) > callDestructionCallbacks() > PoolableProxyHandler.run() <- which is a destruction callback > PoolableFactoryBean.putIntoPool() > PoolableFactoryBean.enteringPool() > component.recycle() > AvalonServiceManager/Selector.release(childComponent) <- component releases its childComponent > AvalonPoolable.putBackIntoAvalonPool() > PoolableProxyHandler.invoke() <- intercepts the putBackIntoAvalonPool() call > RequestContextHolder.currentRequestAttributes() <-- Exception !!! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.