From issues-return-43814-archive-asf-public=cust-asf.ponee.io@karaf.apache.org Fri Apr 5 16:30:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D465A18060F for ; Fri, 5 Apr 2019 18:30:01 +0200 (CEST) Received: (qmail 26029 invoked by uid 500); 5 Apr 2019 16:30:01 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 26007 invoked by uid 99); 5 Apr 2019 16:30:00 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Apr 2019 16:30:00 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5C3B9E01AC for ; Fri, 5 Apr 2019 16:30:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1BF8A24595 for ; Fri, 5 Apr 2019 16:30:00 +0000 (UTC) Date: Fri, 5 Apr 2019 16:30:00 +0000 (UTC) From: "Grzegorz Grzybek (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work stopped] (KARAF-6074) Race condition between the FeaturesService and FeatureDeploymentListener MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-6074?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on KARAF-6074 stopped by Grzegorz Grzybek. ----------------------------------------------- > Race condition between the FeaturesService and FeatureDeploymentListener > ------------------------------------------------------------------------ > > Key: KARAF-6074 > URL: https://issues.apache.org/jira/browse/KARAF-6074 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.2.2, 4.2.4 > Environment: Karaf 4.2.2 Windows 7 and Equinox > Reporter: J. Br=C3=A9bec > Assignee: Grzegorz Grzybek > Priority: Critical > Fix For: 4.2.3 > > > On the first start of a custom Karaf container (4.2.2), the logs shows a = log of NPE in=C2=A0FeatureDeploymentListener. > After some analysis of this Exception, it's look like a race condition be= tween the FeaturesService and the FeatureDeploymentListener : > # The FeaturesService starts and launch a provisioning in another thread > # a FeatureDeploymentListener is registered, and call bundleChanged for = every bundle installed (the startup bundles) > # It calls FeaturesService.state.requirements and get an empty map > # Updating the root regions in the requirements map fails with an NPE > # Some times later, the deployment task launched at step 1 is started, a= nd FeaturesService.saveState() is called :=C2=A0state.requirements."root re= gion" is initialised > The step 5 is executed in another thread, so it can happens before step 2= (and it works) or after, causing this NPE > Moreover, some methods in FeaturesService=C2=A0assume that state.requirem= ents."root region" exists. There are probably others npe here. > =C2=A0 > {code:java} > 14:37:55.668 ERROR [activator-1-thread-2] Unable to update deployed featu= res for bundle: org.eclipse.osgi - 3.12.100.v20180210-1608 > java.lang.NullPointerException: null > at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleCha= nged(FeatureDeploymentListener.java:247) [25:org.apache.karaf.deployer.feat= ures:4.2.2] > at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(Feat= ureDeploymentListener.java:95) [25:org.apache.karaf.deployer.features:4.2.2= ] > at org.apache.karaf.deployer.features.osgi.Activator.doStart(Activator.ja= va:52) [25:org.apache.karaf.deployer.features:4.2.2] > at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:292= ) [25:org.apache.karaf.deployer.features:4.2.2] > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511= ) [?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j= ava:1149) [?:?] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.= java:624) [?:?]{code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)