Fix Graph deletion which cause NPE 71/98371/1
authorOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 9 Nov 2021 10:12:16 +0000 (11:12 +0100)
committerOlivier Dugeon <olivier.dugeon@orange.com>
Tue, 9 Nov 2021 10:12:16 +0000 (11:12 +0100)
commit39099f87a7ae25ff23fcccb3b9dd56a8db7e6527
treeeb3859623d307eea0468dd3711df1139c849f2c8
parent662b4d90c10c681d98bda1e3773b6653808e8ab0
Fix Graph deletion which cause NPE

Graph is deleted twice when stopping ODL which cause a NPE.

When ODL stops, AbstractTopologyBuilder() calls
LinkStateGraphBuilder.clearTopology() which call
ConnectedGraphImpl.clear(). Then ConnectedGraphServer() stops by
calling destroyOperationalGraphModel() which browse all stored graphs
and call again ConnectedGraphImpl.clear() which cause the NPE.

Fix removes graph from ConnectedGraphServer graphs Map in
clearGraph() method instead of deleteGraph() method.

JIRA: BGPCEP-977

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I55209e77ffa2c317ea85ca29cc794016f338c488
graph/graph-impl/src/main/java/org/opendaylight/graph/impl/ConnectedGraphServer.java