Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E4F811BBA for ; Tue, 26 Aug 2014 11:03:58 +0000 (UTC) Received: (qmail 43061 invoked by uid 500); 26 Aug 2014 11:03:58 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 42976 invoked by uid 500); 26 Aug 2014 11:03:58 -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 42963 invoked by uid 99); 26 Aug 2014 11:03:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2014 11:03:58 +0000 Date: Tue, 26 Aug 2014 11:03:58 +0000 (UTC) From: "metatech (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FELIX-3067) Prevent Deadlock Situation in Felix.acquireGlobalLock 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-3067?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] metatech updated FELIX-3067: ---------------------------- Attachment: felix_unblock_deadlock_v2.patch For users stuck on Felix 3.2.* (eg ServiceMix 4.x and 5.x users), here is a slightly modified version of the patch, handling the case where the time to wait has to be strictly positive. > Prevent Deadlock Situation in Felix.acquireGlobalLock > ----------------------------------------------------- > > Key: FELIX-3067 > URL: https://issues.apache.org/jira/browse/FELIX-3067 > Project: Felix > Issue Type: Improvement > Components: Framework > Affects Versions: framework-3.0.7, framework-3.0.8, framework-3.0.9, framework-3.2.0, framework-3.2.1, fileinstall-3.1.10 > Reporter: Felix Meschberger > Attachments: FELIX-3067-sling.patch, FELIX-3067.patch, felix_unblock_deadlock.patch, felix_unblock_deadlock_v2.patch, threaddump-ise-deadlock.txt, threads_locked_by_camel_type_converter > > > Every now and then we encounter deadlock situations which involve the Felix.acquireGlobalLock method. In our use case we have the following aspects which contribute to this: > (a) The Apache Felix Declarative Services implementation stops components (and thus causes service unregistration) while the bundle lock is being held because this happens in a SynchronousBundleListener while handling the STOPPING bundle event. We have to do this to ensure the bundle is not really stopped yet to properly stop the bundle's components. > (b) Implementing a special class loader which involves dynamically resolving packages which in turn uses the global lock > (c) Eclipse Gemini Blueprint implementation which operates asynchronously > (d) synchronization in application classes > Often times, I would assume that we can self-heal such complex deadlck situations, if we let acquireGlobalLock time out. Looking at the calles of acquireGlobalLock there seems to already be provision to handle this case since acquireGlobalLock returns true only if the global lock has actually been acquired. > This issue is kind of a companion to FELIX-3000 where deadlocks involve sending service registration events while holding the bundle lock. -- This message was sent by Atlassian JIRA (v6.2#6252)