karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (KARAF-5854) KAR file installation is not atomic
Date Thu, 22 Nov 2018 13:33:00 GMT

     [ https://issues.apache.org/jira/browse/KARAF-5854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jean-Baptiste Onofré resolved KARAF-5854.
-----------------------------------------
    Resolution: Fixed

> KAR file installation is not atomic
> -----------------------------------
>
>                 Key: KARAF-5854
>                 URL: https://issues.apache.org/jira/browse/KARAF-5854
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.1.4
>            Reporter: Lars Ollén
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>              Labels: kar
>             Fix For: 4.2.2, 4.1.7
>
>
> The KAR file installation process isn't atomic and handles exceptions poorly.
> If a shutdown signal is sent to Karaf while the KAR file is being installed the KAR file
can be unpacked to the data folder but the rest of the installation steps will fail, leaving
an uninstalled KAR file unpacked. That will hinder the KAR file from being installed during
the next startup of Karaf (since Karaf checks only if the KAR file is unpacked and not if
it was installed).
> My initial though was that: '_org.apache.karaf.kar.internal.KarServiceImpl#install(java.net.URI,
java.io.File, java.io.File, boolean)_' should rollback and delete the kar folder in case the
methods such as 'org.apache.karaf.kar.internal.KarServiceImpl#addToFeaturesRepositories' gets
and exception, not sure how that would fit into the Karaf philosophy.
>  
> Below are the exceptions that we see (a bit redacted though):
> 2018-07-05T12:17:07.223+0200 | WARN | XXXXXX | o.a.karaf.kar.internal.KarServiceImpl
| 51 - org.apache.karaf.kar.core - 4.1.4 | Unable to add repository 'mvn:XXXXXXXXXXXXXXXX/xml/features'
> java.lang.IllegalStateException: BundleContext is no longer valid
>  at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:989)
>  at org.eclipse.osgi.internal.framework.BundleContextImpl.getDataFile(BundleContextImpl.java:694)
>  at org.apache.karaf.features.internal.osgi.Activator$1.getOutputStream(Activator.java:205)
>  at org.apache.karaf.features.internal.service.StateStorage.save(StateStorage.java:56)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.saveState(FeaturesServiceImpl.java:360)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:505)
>  at org.apache.karaf.kar.internal.KarServiceImpl.addToFeaturesRepositories(KarServiceImpl.java:266)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:111)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:95)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:87)
>  at org.apache.karaf.deployer.kar.KarArtifactInstaller.install(KarArtifactInstaller.java:50)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:950)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:884)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:489)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)
> 2018-07-05T12:17:07.226+0200 | WARN | XXXXXXX | o.a.karaf.kar.internal.KarServiceImpl
| 51 - org.apache.karaf.kar.core - 4.1.4 | Unable to install Kar feature XXXXXXXXXXXXXXXXX
> java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@5222a1f2
rejected from java.util.concurrent.ThreadPoolExecutor@36cfb96[Terminated, pool size = 0, active
threads = 0, queued tasks = 0, completed tasks = 1]
>  at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
>  at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
>  at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
>  at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
>  at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:681)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvisionInThread(FeaturesServiceImpl.java:1146)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:1022)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:915)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:900)
>  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:910)
>  at org.apache.karaf.kar.internal.KarServiceImpl.installFeatures(KarServiceImpl.java:295)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:118)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:95)
>  at org.apache.karaf.kar.internal.KarServiceImpl.install(KarServiceImpl.java:87)
>  at org.apache.karaf.deployer.kar.KarArtifactInstaller.install(KarArtifactInstaller.java:50)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:950)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:884)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:489)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
>  at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)
>  



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

Mime
View raw message