Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 14328 invoked from network); 15 Sep 2010 20:12:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Sep 2010 20:12:27 -0000 Received: (qmail 16969 invoked by uid 500); 15 Sep 2010 20:12:27 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 16589 invoked by uid 500); 15 Sep 2010 20:12:26 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 16541 invoked by uid 99); 15 Sep 2010 20:12:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 20:12:25 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Sep 2010 20:12:25 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8FKC57G010522 for ; Wed, 15 Sep 2010 20:12:05 GMT Message-ID: <30400861.211181284581525097.JavaMail.jira@thor> Date: Wed, 15 Sep 2010 16:12:05 -0400 (EDT) From: "Richard S. Hall (JIRA)" To: dev@felix.apache.org Subject: [jira] Closed: (FELIX-2597) Deadlock during delivery of resolved event In-Reply-To: <27409368.166901284418892432.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard S. Hall closed FELIX-2597. ---------------------------------- Resolution: Fixed I've committed a patch for this. > Deadlock during delivery of resolved event > ------------------------------------------ > > Key: FELIX-2597 > URL: https://issues.apache.org/jira/browse/FELIX-2597 > Project: Felix > Issue Type: Improvement > Components: Framework > Affects Versions: framework-3.0.2 > Reporter: Richard S. Hall > Assignee: Richard S. Hall > Priority: Minor > Fix For: framework-3.0.3 > > > When the framework resolves a bundle, it fires the RESOLVED event to synchronous bundle listeners while holding the global lock. This caused a deadlock in a specific scenario where two threads T1 and T2 were racing to resolve bundles B1 and B2, respectively. T1 was resolving a dynamic import for B1 which started from a loadClassInternal() call from the JVM which locks B1's class loader. T1 lost the race for the global lock and had to wait for T2 to do its resolve of B2. T2 resolved B2 and ended up firing a RESOLVED event to B1. In B1's callback method, a loadClassInternal() was triggered by T2 when it accessed some static, which caused it to deadlock when the JRE tried to lock the B1's class loader on T2, which was already held by T1. > This issue is actually related to the JVM being too aggressively in its locking of class loaders: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4670071 > Regardless, we might be able to loosen this up a little bit by not holding the global lock at all. This might slightly violate the definition of synchronous bundle listener, since the state could change, but at least it will still be delivered synchronously on the instigating thread. > More information here: > https://glassfish.dev.java.net/issues/show_bug.cgi?id=13329 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.