karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J. Brébec (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-6074) Race condition between the FeaturesService and FeatureDeploymentListener
Date Thu, 04 Apr 2019 08:50:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-6074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16809624#comment-16809624
] 

J. Brébec commented on KARAF-6074:
----------------------------------

I see. In my custom distribution, the deployer.features is referenced as a startup bundle,
in startup.properties.

{code}
# Bundles to be started on startup, with startlevel
mvn\:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.4 = 1
mvn\:org.apache.felix/org.apache.felix.metatype/1.2.2 = 5
mvn\:org.apache.karaf.services/org.apache.karaf.services.eventadmin/4.2.4 = 5
mvn\:org.ops4j.pax.url/pax-url-aether/2.6.1 = 5
mvn\:org.ops4j.pax.url/pax-url-wrap/2.6.1/jar/uber = 5
mvn\:org.fusesource.jansi/jansi/1.17.1 = 8
mvn\:org.ops4j.pax.logging/pax-logging-api/1.10.1 = 8
mvn\:org.ops4j.pax.logging/pax-logging-log4j2/1.10.1 = 8
mvn\:org.apache.felix/org.apache.felix.coordinator/1.0.2 = 9
mvn\:org.apache.felix/org.apache.felix.configadmin/1.9.14 = 10
mvn\:org.apache.felix/org.apache.felix.fileinstall/3.6.4 = 11
mvn\:org.apache.karaf.features/org.apache.karaf.features.core/4.2.4 = 15
mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1 = 20
mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.3.1 = 20
mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 = 20
mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.10.1 = 20
mvn\:org.apache.aries.proxy/org.apache.aries.proxy/1.1.4 = 20
mvn\:org.ow2.asm/asm-analysis/7.1 = 20
mvn\:org.ow2.asm/asm-commons/7.1 = 20
mvn\:org.ow2.asm/asm-tree/7.1 = 20
mvn\:org.ow2.asm/asm-util/7.1 = 20
mvn\:org.ow2.asm/asm/7.1 = 20
mvn\:org.apache.karaf.deployer/org.apache.karaf.deployer.blueprint/4.2.4 = 24
mvn\:org.apache.karaf.deployer/org.apache.karaf.deployer.wrap/4.2.4 = 24
mvn\:org.apache.karaf.deployer/org.apache.karaf.deployer.features/4.2.4 = 26
mvn\:org.apache.karaf.bundle/org.apache.karaf.bundle.blueprintstate/4.2.4 = 30
mvn\:org.apache.karaf.bundle/org.apache.karaf.bundle.core/4.2.4 = 30
mvn\:org.apache.karaf.config/org.apache.karaf.config.core/4.2.4 = 30
mvn\:org.apache.karaf.diagnostic/org.apache.karaf.diagnostic.boot/4.2.4 = 30
mvn\:org.apache.karaf.diagnostic/org.apache.karaf.diagnostic.core/4.2.4 = 30
mvn\:org.apache.karaf.features/org.apache.karaf.features.command/4.2.4 = 30
mvn\:org.apache.karaf.jaas.blueprint/org.apache.karaf.jaas.blueprint.config/4.2.4 = 30
mvn\:org.apache.karaf.jaas/org.apache.karaf.jaas.command/4.2.4 = 30
mvn\:org.apache.karaf.jaas/org.apache.karaf.jaas.config/4.2.4 = 30
mvn\:org.apache.karaf.jaas/org.apache.karaf.jaas.modules/4.2.4 = 30
mvn\:org.apache.karaf.log/org.apache.karaf.log.core/4.2.4 = 30
mvn\:org.apache.karaf.package/org.apache.karaf.package.core/4.2.4 = 30
mvn\:org.apache.karaf.service/org.apache.karaf.service.core/4.2.4 = 30
mvn\:org.apache.karaf.shell/org.apache.karaf.shell.commands/4.2.4 = 30
mvn\:org.apache.karaf.shell/org.apache.karaf.shell.console/4.2.4 = 30
mvn\:org.apache.karaf.shell/org.apache.karaf.shell.core/4.2.4 = 30
mvn\:org.apache.karaf.shell/org.apache.karaf.shell.ssh/4.2.4 = 30
mvn\:org.apache.karaf.shell/org.apache.karaf.shell.table/4.2.4 = 30
mvn\:org.apache.karaf.system/org.apache.karaf.system.core/4.2.4 = 30
mvn\:org.apache.karaf/org.apache.karaf.event/4.2.4 = 30
mvn\:org.apache.servicemix.bundles/org.apache.servicemix.bundles.not-yet-commons-ssl/0.3.11_1
= 30
mvn\:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0 = 30
mvn\:org.apache.sshd/sshd-core/1.7.0 = 30
mvn\:org.jline/jline-builtins/3.10.0 = 30
mvn\:org.jline/jline-reader/3.10.0 = 30
mvn\:org.jline/jline-terminal-jansi/3.10.0 = 30
mvn\:org.jline/jline-terminal/3.10.0 = 30
{code}

I'll defined this in my pom :

{code}
    <startupFeatures>
         <feature>eventadmin</feature>
         <feature>wrap</feature>
     </startupFeatures>
{code}

I'll check why my custom distrib generate this.

> 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ébec
>            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 FeatureDeploymentListener.
> After some analysis of this Exception, it's look like a race condition between 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, and FeaturesService.saveState()
is called : state.requirements."root region" 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 assume that state.requirements."root region"
exists. There are probably others npe here.
>  
> {code:java}
> 14:37:55.668 ERROR [activator-1-thread-2] Unable to update deployed features for bundle:
org.eclipse.osgi - 3.12.100.v20180210-1608
> java.lang.NullPointerException: null
> at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleChanged(FeatureDeploymentListener.java:247)
[25:org.apache.karaf.deployer.features:4.2.2]
> at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(FeatureDeploymentListener.java:95)
[25:org.apache.karaf.deployer.features:4.2.2]
> at org.apache.karaf.deployer.features.osgi.Activator.doStart(Activator.java: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.java:1149) [?:?]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message