You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2021/05/01 05:36:00 UTC
[jira] [Commented] (KARAF-7129) Fix race condition in
org.apache.karaf.shell.ssh.Activator
[ https://issues.apache.org/jira/browse/KARAF-7129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17337730#comment-17337730 ]
Jean-Baptiste Onofré commented on KARAF-7129:
---------------------------------------------
It's both a race condition (cause in the feature) or missing tracker requirement: sftp service starts before the configuration admin service is there. I agree that we should reference the service in the tracker. I will fix that. Thanks.
> Fix race condition in org.apache.karaf.shell.ssh.Activator
> ----------------------------------------------------------
>
> Key: KARAF-7129
> URL: https://issues.apache.org/jira/browse/KARAF-7129
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Affects Versions: 4.2.11
> Reporter: Steven Huypens
> Assignee: Jean-Baptiste Onofré
> Priority: Major
>
> When starting our custom Karaf distribution, we're always seeing this stacktrace in the logs. Everything seems to be working, I'm not sure how to explain that, but still seems a little bug to me.
>
> {code:java}
> 2021-04-30 12:13:56,385 - [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO - org.apache.sshd.sftp/2.5.1 2021-04-30 12:13:56,385 - [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO - org.apache.sshd.sftp/2.5.1 2021-04-30 12:13:56,387 - [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO - org.apache.karaf.shell.ssh/4.2.11 2021-04-30 12:13:56,399 - [o.a.k.s.s.Activator ][activator-1-thread-1] WARN - Error starting activator java.lang.IllegalStateException: Service not tracked for class interface org.osgi.service.cm.ConfigurationAdmin at org.apache.karaf.util.tracker.BaseActivator.getTrackedService(BaseActivator.java:369) at org.apache.karaf.util.tracker.BaseActivator.ensureStartupConfiguration(BaseActivator.java:154) at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:96) at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:312) 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) at java.lang.Thread.run(Thread.java:748)2021-04-30 12:13:56,426 - [o.a.k.s.i.a.o.CommandExtension][features-3-thread-1] INFO - Command registration delayed for bundle org.apache.karaf.shell.ssh/4.2.11. Missing service: [org.apache.sshd.server.SshServer] {code}
>
> I had a look at the org.apache.karaf.shell.ssh.Activator and I feel like it's missing a
> @RequireService(ConfigurationAdmin.class) because that service is required by the method
> ensureStartupConfiguration() and the only other Activator using that method does have the @RequireService(ConfigurationAdmin.class) .
>
> Also, it might be better to add a null-check for this service in the doStart()-method
>
> {code:java}
> ConfigurationAdmin configurationAdmin = getTrackedService(ConfigurationAdmin.class);
> if (configurationAdmin == null ) {
> return;
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)