In drivers/ovsdb/src/main/java/org/onosproject/drivers/ovsdb/OvsdbBridgeConfig.java,
if the OVSDB connection is closed before calling getOvsdbClientService() method,
getOvsdbClientService() method returns null,
And this 'null' OvsdbClientService causes NullPointerException in 'createBridge()'
drivers/ovsdb/src/main/java/org/onosproject/drivers/ovsdb/OvsdbBridgeConfig.java
public class OvsdbBridgeConfig extends AbstractHandlerBehaviour implements BridgeConfig { .... @Override public boolean addBridge(BridgeDescription bridgeDesc) { // before here, OVSDB connection is closed, // variable 'client' becomes 'null'. OvsdbClientService client = getOvsdbClientService(handler()); OvsdbBridge.Builder bridgeBuilder = OvsdbBridge.builder(bridgeDesc); if (bridgeDesc.enableLocalController()) { bridgeBuilder.controller(client.localController()); } //This invocation causes 'NullPointerException' as 'client' is 'null' return client.createBridge(bridgeBuilder.build()); }
The null point 'client' variable should be handled.
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
12430,2 | [ONOS-5845] NullPointerException occurs, if OVSDB connection is closed while creating a OVS bridge on OVS. | master | onos | Status: MERGED | +2 | +1 |