-
Type: Bug
-
Status: To Do (View Workflow)
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: SEBA-Next
-
Component/s: ONOS & Apps
-
Labels:None
-
Environment:
dhcpl2relay version: 1.6.0
-
Story Points:2
-
Epic Link:
If useOltUplinkForServerPktInOut is set to true when org.opencord.dhcpl2relay (version 1.6.0) is being activated, it'll hit a NPE
2019-09-26 19:27:51,823 | ERROR | p-app-activation | dhcpl2relay-app | 180 - org.opencord.dhcpl2relay-app - 1.6.0 | [org.opencord.dhcpl2relay.impl.DhcpL2Relay(172)] The activate method has thrown an exception java.lang.NullPointerException at org.opencord.dhcpl2relay.impl.DhcpL2Relay.getUplinkPortsOfOlts(DhcpL2Relay.java:375) at org.opencord.dhcpl2relay.impl.DhcpL2Relay.updateConfig(DhcpL2Relay.java:297) at org.opencord.dhcpl2relay.impl.DhcpL2Relay.activate(DhcpL2Relay.java:199)
It's because in activate() function, updateConfig() is called before subsService gets initiated.
This only happens when ONOS already has some devices discovered when dhcpl2relay is being activated and in our case it's the AGG switch. We should probably add a filter to check only OLT devices here:
// find all the olt devices and if their uplink ports are visible Iterable<Device> devices = deviceService.getDevices(); for (Device d : devices) { ... }