Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-5845

NullPointerException occurs, if OVSDB connection is closed while creating a OVS bridge on OVS.

    XMLWordPrintable

    Details

    • Story Points:
      1
    • Sprint:
      Junco Sprint #2 - Platform

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              jaegonkim Jaegon Kim
              Reporter:
              jaegonkim Jaegon Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: