Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FB31F1B7 for ; Fri, 22 Mar 2013 12:59:26 +0000 (UTC) Received: (qmail 96672 invoked by uid 500); 22 Mar 2013 12:59:25 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 96571 invoked by uid 500); 22 Mar 2013 12:59:25 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 96550 invoked by uid 99); 22 Mar 2013 12:59:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 12:59:25 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@adobe.com designates 64.18.1.25 as permitted sender) Received: from [64.18.1.25] (HELO exprod6og110.obsmtp.com) (64.18.1.25) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 22 Mar 2013 12:59:16 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob110.postini.com ([64.18.5.12]) with SMTP ID DSNKUUxVjE8HNHa4+FRXdcArHPx8NOttVhBC@postini.com; Fri, 22 Mar 2013 05:58:56 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1.sea.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r2MCwp2h017128; Fri, 22 Mar 2013 05:58:51 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r2MCwoAV015901; Fri, 22 Mar 2013 05:58:50 -0700 (PDT) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.298.1; Fri, 22 Mar 2013 05:58:50 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurhub01.eur.adobe.com ([10.128.4.30]) with mapi; Fri, 22 Mar 2013 12:58:47 +0000 From: Felix Meschberger To: "users@felix.apache.org" CC: "Allen, Cheryl L" Date: Fri, 22 Mar 2013 12:58:47 +0000 Subject: Re: Race conditions with bundle states Thread-Topic: Race conditions with bundle states Thread-Index: Ac4m/P16hABbHwU/RtGJj219aVyudw== Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi I have the impression, that from your event handler you should not cause th= e bundle to be resolved. Wouldn't you want to wait for the RESOLVED event ? Or event the STARTED eve= nt ? Regards Felix Am 22.03.2013 um 13:43 schrieb Humeniuk, David P: > I have a thread that does a Bundle.update() call. >=20 >=20 >=20 > I have an EventAdmin based EventHandler that listens for bundle updated > events. The event handler will call Bundle.findEntries which causes a > resolve of the updated bundle. >=20 >=20 >=20 > The update call will sometimes fail with the exception: >=20 >=20 >=20 > [java] ERROR 20130321 23:34:11 ID#19 - Request to update bundle 9 > failed. >=20 > [java] org.osgi.framework.BundleException: Unable to acquire global > lock for resolve. >=20 > [java] Caused by: org.apache.felix.log.LogException: > org.osgi.framework.BundleException: Unable to acquire global lock for > resolve. >=20 > [java] at > org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980) >=20 > [java] at > org.apache.felix.framework.Felix.startBundle(Felix.java:2037) >=20 > [java] at > org.apache.felix.framework.Felix.updateBundle(Felix.java:2404) >=20 > [java] at > org.apache.felix.framework.BundleImpl.update(BundleImpl.java:973) >=20 >=20 >=20 > We are running the latest Framework 4.2.1. We also seen this happen > previously on 4.0.3. >=20 >=20 >=20 > So the event handler will be triggered to resolve bundles and acquires > the global lock, then later the thread doing the update will try to > resolve and get the global lock (but the other thread wants its bundle > lock). So I guess the code does what it needs to, to prevent a deadlock > state. I guess I'm wondering, how should I be trying to interact with > the API in this case. Should I be putting a retry on my update call? > Something else? Is there something that explains the different locks > and how to work with them in the API or elsewhere? >=20 >=20 >=20 > Thanks, >=20 > Dave Humeniuk >=20 > Software Engineer >=20 > Sensor System Division (SSD) >=20 > University of Dayton Research Institute >=20 >=20 >=20 -- Felix Meschberger | Principal Scientist | Adobe --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org