Description
I found a leak, where SCR component publishes service related to osgi.command and registration event is:
- both handled in org.apache.karaf.service.guard.impl.GuardProxyCatalog#handleProxificationForHook()
- passed to org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl#commandTracker
The reason for this is that one of the bundles iterated over in org.apache.karaf.service.guard.impl.GuardingEventHook#event may throw IllegalStateException when invoking bundleContext.getBundle().getBundleId().
When the service for command is then unregistered, the unregistration event may be this time filtered out and we have duplicate command in org.apache.felix.gogo.runtime.CommandProcessorImpl#commands