[BGPCEP-680] NPE during singleton startup Created: 04/Aug/17 Updated: 03/Mar/19 Resolved: 11/Oct/17 |
|
| Status: | Resolved |
| Project: | bgpcep |
| Component/s: | BGP |
| Affects Version/s: | Bugzilla Migration |
| Fix Version/s: | Bugzilla Migration |
| Type: | Bug | ||
| Reporter: | Robert Varga | Assignee: | Yrineu Felipe Rodrigues |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| External issue ID: | 8929 |
| Description |
|
2017-08-04 17:06:30,736 | ERROR | ult-dispatcher-3 | ClusterSingletonServiceGroupImpl | 183 - org.opendaylight.mdsal.singleton-dom-impl - 2.3.0.Nitrogen | Unexpected exception state for service Provider example-bgp-rib-service-group in TakeLeadership Reproduced using: feature:install odl-bgpcep-bgp-rib-api |
| Comments |
| Comment by Robert Varga [ 04/Aug/17 ] |
|
Attachment karaf.log has been added with description: karaf.log |
| Comment by Robert Varga [ 04/Aug/17 ] |
|
This is something in: final ChoiceNode routes = this.ribContextRegistry.getRIBSupportContext(key).getRibSupport().emptyRoutes(); |
| Comment by Yrineu Felipe Rodrigues [ 06/Sep/17 ] |
|
Hi Robert Varga, I believe that the root cause of that issue is concurrency. I did checked the parameters and there's no 'Null' parameters. To solve that problem maybe should be interesting to evaluate a little refactoring in order to remove some dependencies from the constructor and avoid some static methods. I'm trying to provide it, but if do you have some other tip, please let me know. regards, |
| Comment by Yrineu Felipe Rodrigues [ 06/Sep/17 ] |
|
Hi Robert Varga, This problem is happening because the 'RIBSupportContextRegistryImpl ribContextRegistry' doesn't have 'TablesKey' registered for IPv4 and IPv6 Unicast. org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily, _safi=class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily, _safi=class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily Please, let me know if do you have some tips to solve that. I believe that some sub-module have to register those keys at the startup. regards, |
| Comment by Yrineu Felipe Rodrigues [ 08/Sep/17 ] |
|
It follows a patch that solve this issue. https://git.opendaylight.org/gerrit/#/c/62870/2 This issue just happens when try to install those features individually instead install 'odl-bgpcep-bgp'. That patch avoid a NPE once IPv4Address and IPv6Address Unicast AFI aren't registered at RIB context. |
| Comment by Claudio David Gasparini [ 11/Sep/17 ] |
|
Adding conversation under proposed fix to bug Claudio D. Gasparini |
| Comment by Claudio David Gasparini [ 11/Sep/17 ] |
|
Hi, some notes Actual 2017-09-09 00:11:06,177 | INFO | pool-2-thread-1 | xtensionProviderContextActivator | 100 - org.opendaylight.bgpcep.bgp-rib-spi - 0.9.0.SNAPSHOT | Starting 0 RIBExtensionProviderActivator instances 2017-09-09 00:11:49,148 | INFO | pool-2-thread-1 | BGPActivator | 222 - org.opendaylight.bgpcep.bgp-inet - 0.9.0.SNAPSHOT | Starting Inet BGP Activator 2017-09-09 00:11:49,610 | INFO | pool-2-thread-1 | BgpDeployerImpl | 228 - org.opendaylight.bgpcep.bgp-rib-impl - 0.9.0.SNAPSHOT | BGP Deployer global-bgp started. steps feature:install odl-bgpcep-bgp-rib-api ===================================================== Expected 2017-09-09 00:30:55,229 | INFO | pool-2-thread-1 | BGPActivator | 98 - org.opendaylight.bgpcep.bgp-inet - 0.9.0.SNAPSHOT | Starting Inet BGP Activator 2017-09-09 00:30:55,247 | INFO | rint Extender: 2 | xtensionProviderContextActivator | 105 - org.opendaylight.bgpcep.bgp-rib-spi - 0.9.0.SNAPSHOT | Starting 1 RIBExtensionProviderActivator instances 2017-09-09 00:31:38,113 | INFO | pool-2-thread-1 | BgpDeployerImpl | 228 - org.opendaylight.bgpcep.bgp-rib-impl - 0.9.0.SNAPSHOT | BGP Deployer global-bgp started. feature:install odl-bgpcep-bgp-inet Conclusion: Issue here is that SimpleRIBExtensionProviderContext under rib-spi is created and expose RIBExtensionProviderContext service before that any extension is loaded. Fix should imply that all(not only inet) extension must be loaded before service is exposed. Otherwise any race condition combined with BGP Deployer, So we need that this steps are done in order 1 - Load all extensions As you can see the fix involves more than fix the NPE, and needs more thought. I hope this can help you. Regards, Claudio |
| Comment by Robert Varga [ 25/Sep/17 ] |
|
[25/09/2017 18:58:38] <yrineu_rodrigues> let me ask you... there is some way to choose the 'load order' of each module? So the issue with registry-type things is that OSGi and karaf's feature:install approach does not really tell us when loading is complete (there is an API in 4.1.x which will help a bit), but even that is only valid until the user types feature:install. At any case, we should be able to start loc-rib without any extensions – so that part is a bug. Going forward, I am not sure it was implemented, but the idea was for the registry to signal when a new extension is loaded and the BGP sessions would be flapped (which is not nice, but gets the job done). Another option is to have rib-impl check its configuration and figure out the afis/safis required for startup – before starting netty. |
| Comment by Yrineu Felipe Rodrigues [ 25/Sep/17 ] |
|
@Claudio and @Robert, makes sense to create a new karaf module in order to install in a single place all contents of: something like: 'odl-bgpcep-bgp-extensions' that will involve all dependencies of those features above. Thus we can ensure that all extensions will be loaded and avoid install features with missing extensions. Please, let me know what do you think about that. |
| Comment by Robert Varga [ 25/Sep/17 ] |
|
I think it would be okay if bgp/rib-impl depended on bgp/inet. While inet is independent as an implementation, it is also part of RFC7460, which is what we claim to support by default. Aside from this bgp/inet should not be special, e.g. remain a plugin outside of bgp/parser-impl. |
| Comment by Yrineu Felipe Rodrigues [ 26/Sep/17 ] |
|
Hi @Robert and @Claudio, It follows a patch with a proposed fix: PS: Still waiting for Jenkins |
| Comment by Claudio David Gasparini [ 10/Oct/17 ] |
|
Hi Yrineu, proposed patch for fix the NPE regarding you proposal to force odl-bgpcep-bgp-rib-impl to be part of odl-bgpcep-bgp-inet. Their should keep their dependency, and this is not a fixing any issue. The issue to be fixed is that when a new extension is installed. All started session are not restarting and loading this new supported expansion. I'll open a bug with defined task and requirements for solve the issue previously described. Regarding this bug, I'll close it as soon as I can check that you patch solved the NPE, if you already tested that feature:install odl-bgpcep-bgp-rib-api doesn't longer cause the NPE, feel free to close it. Regards, |
| Comment by Yrineu Felipe Rodrigues [ 11/Oct/17 ] |
|
Thanks for your update! |