[MDSAL-356] Fail earlier/faster/more clearly in case of modules with same name but different namespaces (and more checks?) Created: 21/Jun/18 Updated: 09/Apr/20 |
|
| Status: | Confirmed |
| Project: | mdsal |
| Component/s: | DOM runtime |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Michael Vorburger | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
As raised on https://lists.opendaylight.org/pipermail/mdsal-dev/2018-June/001709.html : The new ODL "serviceutils" project is hitting a weird issue in the integration/distribution karaf run, which makes me suspect there may be a concurrency related issue in BindingToNormalizedNodeCodec, or code used by it: 2018-06-20T18:35:42,573 | ERROR | SystemReadyService-0 | TestBundleDiag | 350 - org.opendaylight.infrautils.ready-impl - 1.4.0.SNAPSHOT | NOK org.opendaylight.serviceutils.srm-impl:0.2.0.SNAPSHOT: OSGi state = Active, Karaf bundleState = Failure, due to: Declarative ServicesBlueprint6/20/18 6:35 PMException: Unable to initialize bean .component-2org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .component-2 at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:738) (...) Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: Error processing "rpc-implementation" for class org.opendaylight.serviceutils.srm.impl.SrmRpcProvider at org.opendaylight.controller.blueprint.ext.RpcImplementationBean.init(RpcImplementationBean.java:69) (...) Caused by: java.lang.IllegalStateException: Schema for interface org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpcs.rev170711.SrmRpcsService is not available. at com.google.common.base.Preconditions.checkState(Preconditions.java:585) at org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec.getModuleBlocking(BindingToNormalizedNodeCodec.java:303) This is seen on https://jenkins.opendaylight.org/releng/job/distribution-check-fluorine/69/consoleFull, but several people have locally done a "mvn clean install" on integration/distribution master, and not been able to locally reproduce above... so it would seem that under some... timing I've found a few issues from the past which seem possibly related to this: |
| Comments |
| Comment by Michael Vorburger [ 21/Jun/18 ] |
|
I'll be raising a series of patches on https://git.opendaylight.org/gerrit/#/q/topic:MDSAL-354 which add more detailed logging in case of the error above. |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
Attached karaf.log.zip from https://lists.opendaylight.org/pipermail/controller-dev/2018-June/014497.html |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
I wonder if this is "just an impact", or could be the cause of the problems seen here - tpantelis perhaps you have any thoughts? 2018-06-26T14:56:07,529 | ERROR | Framework Event Dispatcher: org.eclipse.osgi.internal.framework.EquinoxEventPublisher@748741cb | srm-shell | 518 - org.opendaylight.serviceutils.srm-shell - 0.2.0.SNAPSHOT | FrameworkEvent ERROR - org.opendaylight.serviceutils.srm-shell java.util.NoSuchElementException: No value present at java.util.Optional.get(Optional.java:135) ~[?:?] at org.opendaylight.controller.blueprint.ext.RpcUtil.decomposeRpcService(RpcUtil.java:39) ~[?:?] at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.retrievedSchemaContext(AbstractInvokableServiceMetadata.java:91) ~[?:?] at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.onSchemaService(AbstractInvokableServiceMetadata.java:85) ~[?:?] at org.opendaylight.controller.blueprint.ext.StaticServiceReferenceRecipe.retrack(StaticServiceReferenceRecipe.java:75) ~[?:?] at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.start(AbstractServiceReferenceRecipe.java:140) ~[18:org.apache.aries.blueprint.core:1.8.3] at org.opendaylight.controller.blueprint.ext.StaticServiceReferenceRecipe.startTracking(StaticServiceReferenceRecipe.java:46) ~[276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.opendaylight.controller.blueprint.ext.AbstractDependentComponentFactoryMetadata.retrieveService(AbstractDependentComponentFactoryMetadata.java:120) ~[276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.opendaylight.controller.blueprint.ext.AbstractDependentComponentFactoryMetadata.retrieveService(AbstractDependentComponentFactoryMetadata.java:105) ~[276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.opendaylight.controller.blueprint.ext.AbstractInvokableServiceMetadata.onRpcRegistry(AbstractInvokableServiceMetadata.java:78) ~[276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.opendaylight.controller.blueprint.ext.StaticServiceReferenceRecipe.retrack(StaticServiceReferenceRecipe.java:75) [276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.opendaylight.controller.blueprint.ext.StaticServiceReferenceRecipe.track(StaticServiceReferenceRecipe.java:52) [276:org.opendaylight.controller.blueprint:0.9.0.SNAPSHOT] at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceAdded(AbstractServiceReferenceRecipe.java:362) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceChanged(AbstractServiceReferenceRecipe.java:341) [18:org.apache.aries.blueprint.core:1.8.3] at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?] at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920) [?:?] at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?] at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?] at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?] at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?] at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?] at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?] at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469) [?:?] at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:472) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:726) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:412) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:275) [18:org.apache.aries.blueprint.core:1.8.3] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) [18:org.apache.aries.blueprint.core:1.8.3] at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) [18:org.apache.aries.blueprint.core:1.8.3] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?] 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) [?:?] |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
https://git.opendaylight.org/gerrit/#/c/73442/ will provide more details to help understand this - but I expect that it will only re-confirm that there is some weird problem related to the SrmRpcsService, with an IllegalArgumentException with details, instead of this NoSuchElementException. |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
OK, forget about integration/distribution... we can now reproduce this more easily - credit for the original idea goes to k.faseela who said on IRC that "the failure happens only with odl-integration-all, and not even with odl-genius-rest.. I was doubting whether it is failing only when two srm-rpcs are there (even though the namepsace is diferent)", so I just added
<dependency>
<groupId>org.opendaylight.genius</groupId>
<artifactId>odl-genius-srm</artifactId>
<version>0.5.0-SNAPSHOT</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
to serviceutils/features/odl-serviceutils-srm and, bingo - the SFT of odl-serviceutils-srm now fails with above! This increasingly points to us having identified a bug in a corner case in mdsal - there must be something somewhere not handling the namespace of RPCs correctly. |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
2018-06-26T13:46:19,967 | ERROR | Framework Event Dispatcher: org.eclipse.osgi.internal.framework.EquinoxEventPublisher@2f8f5f62 | srm-shell
| 199 - org.opendaylight.serviceutils.srm-shell - 0.2.0.SNAPSHOT | FrameworkEvent ERROR - org.opendaylight.serviceutil
s.srm-shell
java.lang.IllegalArgumentException: Module not found in SchemaContext: QNameModule{ns=urn:opendaylight:serviceutils:srm:rpcs, rev=2017-07-11}
; service: interface org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpcs.rev170711.SrmRpcsService
at org.opendaylight.controller.blueprint.ext.RpcUtil.lambda$decomposeRpcService$0(RpcUtil.java:39) ~[?:?]
at java.util.Optional.orElseThrow(Optional.java:290) ~[?:?]
at org.opendaylight.controller.blueprint.ext.RpcUtil.decomposeRpcService(RpcUtil.java:39) ~[?:?]
|
| Comment by Robert Varga [ 26/Jun/18 ] |
|
As per https://tools.ietf.org/html/rfc7950#section-6.2.1 this is not an infrastructure problem. Module names must be unique. New names should include 'odl-' prefix, i.e. odl-srm-rpcs. |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
rovarga thanks for the clarification! k.faseela will do renaming (in the new serviceutils, not the existing genius; they want to remove that one, after having migrated to serviceutils FYI). But instad of moving this JIRA from mdsal to genius project, could we have this for a possible future Enhancement as outlined on https://lists.opendaylight.org/pipermail/mdsal-dev/2018-June/001725.html - would that be in yangtools? |
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
> possible future Enhancement as outlined on rovarga on IRC suggested this would have to be in mdsal-binding-dom-codec, and said:
|
| Comment by Michael Vorburger [ 26/Jun/18 ] |
|
|