[CONTROLLER-1958] Blueprint seems to mis-manage RpcConsumerRegistry references Created: 01/Aug/20  Updated: 15/Jan/24  Resolved: 15/Jan/24

Status: Resolved
Project: controller
Component/s: blueprint
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to CONTROLLER-2090 Remove support for RPCs/Actions/Notif... Resolved

 Description   

This was detected while converting to declarative services. While the underlying issue is https://issues.apache.org/jira/browse/FELIX-6315, it seems blueprint is triggering it by mismatching component lifecycle:

2020-07-31T23:02:08,267 | INFO  | Blueprint Extender: 1 | AbstractAdaptedService           | 145 - org.opendaylight.mdsal.binding-dom-adapter - 6.0.5.SNAPSHOT | Binding/DOM adapter for RpcConsumerRegistry deactivated (0)
java.lang.Throwable: null
        at org.opendaylight.mdsal.binding.dom.adapter.osgi.AbstractAdaptedService.stop(AbstractAdaptedService.java:40) [bundleFile:?]
        at org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiRpcConsumerRegistry.deactivate(OSGiRpcConsumerRegistry.java:41) [bundleFile:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:242) [bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) [bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:678) [bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:524) [bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:318) [bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:308) [bundleFile:?]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:409) [bundleFile:?]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:164) [bundleFile:?]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:1022) [bundleFile:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$2.run(ServiceFactoryUse.java:260) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$2.run(ServiceFactoryUse.java:1) [org.eclipse.osgi-3.12.100.jar:?]
        at java.security.AccessController.doPrivileged(Native Method) [?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryUngetService(ServiceFactoryUse.java:258) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.ungetService(ServiceFactoryUse.java:160) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.ungetService(ServiceConsumer.java:50) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.ungetService(ServiceRegistrationImpl.java:593) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.ungetService(ServiceRegistry.java:540) [org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.ungetService(BundleContextImpl.java:666) [org.eclipse.osgi-3.12.100.jar:?]
        at org.opendaylight.controller.blueprint.ext.StaticServiceReferenceRecipe.doStop(StaticServiceReferenceRecipe.java:90) [bundleFile:?]
        at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.stop(AbstractServiceReferenceRecipe.java:156) [bundleFile:1.10.2]
        at org.opendaylight.controller.blueprint.ext.AbstractDependentComponentFactoryMetadata.stopServiceRecipes(AbstractDependentComponentFactoryMetadata.java:211) [bundleFile:?]
        at org.opendaylight.controller.blueprint.ext.AbstractDependentComponentFactoryMetadata.stopTracking(AbstractDependentComponentFactoryMetadata.java:197) [bundleFile:?]
        at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.stopTracking(AbstractInvokableServiceMetadata.java:157) [bundleFile:?]
        at org.apache.aries.blueprint.di.DependentComponentFactoryRecipe.stop(DependentComponentFactoryRecipe.java:67) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.untrackServiceReference(BlueprintContainerImpl.java:673) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.untrackServiceReferences(BlueprintContainerImpl.java:653) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:582) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:417) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [bundleFile:1.10.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45) [bundleFile:1.10.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

i.e. at this point the seervice is deactivated (just as a delayed component would be). This is then followed by:

2020-07-31T23:02:08,275 | ERROR | Blueprint Extender: 1 | ServiceRecipe                    | 19 - org.apache.aries.blueprint.core - 1.10.2 | Error retrieving service from ServiceRecipe[name='.component-1']
org.osgi.service.blueprint.container.ComponentDefinitionException: Error getting RPC service for org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService
        at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.create(AbstractInvokableServiceMetadata.java:141) ~[?:?]
        at org.apache.aries.blueprint.di.ComponentFactoryRecipe.internalCreate(ComponentFactoryRecipe.java:47) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:108) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:108) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:268) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:685) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) ~[bundleFile:1.10.2]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:108) ~[bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:285) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:252) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.ServiceRecipe.internalCreate(ServiceRecipe.java:149) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) [bundleFile:1.10.2]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:737) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:433) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [bundleFile:1.10.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) [bundleFile:1.10.2]
        at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45) [bundleFile:1.10.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: com.google.common.base.VerifyException: expected a non-null reference
        at com.google.common.base.Verify.verify(Verify.java:124) ~[?:?]
        at com.google.common.base.Verify.verifyNotNull(Verify.java:500) ~[?:?]
        at com.google.common.base.Verify.verifyNotNull(Verify.java:477) ~[?:?]
        at org.opendaylight.mdsal.binding.dom.adapter.osgi.AbstractAdaptedService.delegate(AbstractAdaptedService.java:44) ~[?:?]
        at org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiRpcConsumerRegistry.getRpcService(OSGiRpcConsumerRegistry.java:31) ~[?:?]
        at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.create(AbstractInvokableServiceMetadata.java:135) ~[?:?]
        ... 33 more


 Comments   
Comment by Robert Varga [ 01/Aug/20 ]

i.e. while the reference to the object is retained, the reference count has been reduced (through the first call stack) and the component has been deactivated – hence attempts to use it are hitting verifyNotNull() failure.

Comment by Robert Varga [ 15/Jan/24 ]

This codepath is removed with CONTROLLER-2090.

Generated at Wed Feb 07 19:56:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.