[BGPCEP-977] Graph fails with NPE Created: 26/Jul/21  Updated: 14/Nov/21  Resolved: 14/Nov/21

Status: Resolved
Project: bgpcep
Component/s: Graph
Affects Version/s: 0.16.1
Fix Version/s: 0.16.10

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Olivier Dugeon
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

CSIT run here:

https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/bgpcep-csit-1node-bgp-ingest-all-phosphorus/110/odl_1/

shows this nasty:

2021-07-26T03:51:15,484 | ERROR | Framework stop - Equinox Container: a89c8372-1e32-4c35-8320-2e341d4c405f | ConnectedGraphServer             | 250 - org.opendaylight.bgpcep.graph-impl - 0.16.1 | bundle org.opendaylight.bgpcep.graph-impl:0.16.1 (250)[org.opendaylight.graph.impl.ConnectedGraphServer(130)] : The close method has thrown an exception
java.lang.NullPointerException: null
        at org.opendaylight.graph.impl.ConnectedGraphImpl.clear(ConnectedGraphImpl.java:299) ~[?:?]
        at org.opendaylight.graph.impl.ConnectedGraphServer.destroyOperationalGraphModel(ConnectedGraphServer.java:146) ~[?:?]
        at org.opendaylight.graph.impl.ConnectedGraphServer.close(ConnectedGraphServer.java:87) ~[?:?]
        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:244) ~[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:685) ~[bundleFile:?]
        at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:529) [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:421) [bundleFile:?]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:165) [bundleFile:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:853) [bundleFile:?]


 Comments   
Comment by Olivier Dugeon [ 09/Nov/21 ]

The problem comes from the fact that graph is deleted twice:

  1. First, when AbstractTopologyBuilder call LinkStateGraphBuilder.clearTopology() which call ConnectedGraphImpl.clear() 
  2. Second, when ConnectedGraphServer close which call destroyOperationalGraphModel() which browse all stored graph and call again ConnectedGraphImpl.clear()

There is 2 solutions to solve the problem:

  • Verify that the graph is valid in ConnectedGraphImpl.clear()
  • Remove graph from ConnectedGraphServer graphs Map in clearGraph() method instead of deleteGraph() method

Second method seems better

 

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