Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 98747 invoked from network); 13 Sep 2010 23:01:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 23:01:55 -0000 Received: (qmail 64413 invoked by uid 500); 13 Sep 2010 23:01:54 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 64345 invoked by uid 500); 13 Sep 2010 23:01:54 -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 64336 invoked by uid 99); 13 Sep 2010 23:01:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 23:01:53 +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; Mon, 13 Sep 2010 23:01:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8DN1W5Z006845 for ; Mon, 13 Sep 2010 23:01:33 GMT Message-ID: <27409368.166901284418892432.JavaMail.jira@thor> Date: Mon, 13 Sep 2010 19:01:32 -0400 (EDT) From: "Richard S. Hall (JIRA)" To: dev@felix.apache.org Subject: [jira] Created: (FELIX-2597) Deadlock during delivery of resolved event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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.2.0 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 bundled B1 and B2, respectively. T1 was resolving a dynamic import for B2 which started from a loadClassInternal() call from the JVM which locks B2's class loader. T1 lost the race for the global lock and had to wait for T2 to do its resolve of B2. T2 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.