[CONTROLLER-1397] BindingAwareBroker has issues invoking BindingAware RPCs Created: 24/Jul/15  Updated: 19/Oct/17  Resolved: 03/Aug/15

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

Type: Bug
Reporter: Ed Warnicke Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive hello.zip    
External issue ID: 4048

 Description   

I am in the process of trying to get IT testing working in the startup archetype.

In the process of doing that, I am getting IT test failures with an exception:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 477.459 sec <<< FAILURE! - in HelloIT
testRPC(HelloIT) Time elapsed: 394.96 sec <<< ERROR!
org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException: No implementation of RPC AbsoluteSchemaPath

{path=[(urn:opendaylight:params:xml:ns:yang:hello?revision=2015-01-05)hello-world]}

available
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRoutingTable.invokeRpc(DOMRpcRoutingTable.java:183)
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter.invokeRpc(DOMRpcRouter.java:124)
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.invoke0(RpcServiceAdapter.java:64)
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.access$000(RpcServiceAdapter.java:42)
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter$RpcInvocationStrategy.invoke(RpcServiceAdapter.java:156)
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.invoke(RpcServiceAdapter.java:95)
at com.sun.proxy.$Proxy84.helloWorld(Unknown Source)
at HelloIT.testRPC(HelloIT.java:57)

This happens in spite of the fact that if I put a debugger breakpoint on HelloIT.java:56 (the line before the exception is thrown) I can successfully access the RPC via Restconf.

The RPC implementation is registered with the BindingAwareBroker via the ProviderContext, and we are attempting to access if in the IT test via the BindingAwareBroker via a ProviderContext. But it appears that the BindingAwareBroker is forwarding it to the DomBroker where the RPC is not being found.

If we try to access it via RestConf however its being access correctly.

To recreate:

As part of doing that, I am using this patch:

https://git.opendaylight.org/gerrit/#/c/16294/

to do IT testing via a parent and base classes, so you will need to build the new directories from there.

You will find attached a hello.zip file which contains the code I am working from. Building hello/ will build hello/it which will run the IT tests and fail appropriately.

The POSTMAN to use RESTCONF is here: https://www.getpostman.com/collections/fe835cc9c7b50343f752



 Comments   
Comment by Ed Warnicke [ 24/Jul/15 ]

Attachment hello.zip has been added with description: hello.zip

Comment by Ed Warnicke [ 24/Jul/15 ]

Further note on recreation:

cd hello/it
mvn clean install -Dkaraf.debug

Will cause the karaf instance for the integration test to run in debug mode on port 5005, which can be handy.

Comment by Ed Warnicke [ 24/Jul/15 ]

What I think I've found via investigation using the debugger:

When I debug HelloIT.testRPC(): I see from:

HelloService service = getSession().getRpcService(HelloService.class);

That the service I am getting back has as its delegate something of type DOMRpcRouter (and note: a different instance than the one I see in the debugger coming back to Restconf). I think this tells me that BindingAwareRPCs are all being routed through the DOM Broker, even when both producer and consumer are BindingAware.

When I drill into HelloIT:57:
Future<RpcResult<HelloWorldOutput>> outputFuture = service.helloWorld(builder.build());

RPCServiceAdapter.invoke():87

final RpcInvocationStrategy rpc = rpcNames.get(method);

gives an rpc of type: RpcServiceAdapter$NonRoutedStrategy

which after a few jumps down the stack takes us to:

DOMRpcRoutingTable.invoke()... which has an rpcs member of type EmptyImmutableBiMap... which I believe is our problem... basically... BindingAware delegates to DOM... and for some reason DOM doesn't have the registration in the DOMRoutingTable that it has.

Please note though... if I stick a break point in DOMRoutingTable.invoke and invoke restconf... its a different object which does have the HelloWorld RPC in its rpcs member.

Comment by Tony Tkacik [ 24/Jul/15 ]

Which initial config are you using to replicate your problem?

There should be one instance of DOMRpcRouter if not, I would suspect configuration problem.

In Lithium - binding shortcut was removed - but there is no performance hit, even if DOM Broker is used data are not serialized / deserialized to DOM.

Comment by Ed Warnicke [ 24/Jul/15 ]

Logs of a failed run can be found here:

http://pastebin.com/eyYxJCgL

Comment by Tony Tkacik [ 03/Aug/15 ]

Turned out test staticly binded to first Broker available. During boot-up with clustering enabled - broker is started and then replaced with newer instance.

Test code ended using first broker for tests and applications using second test.

Fix in test to not use pax-exam @Inject capability fixed issue.

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