VOL-5113:OnuAdapter crashes Intermittently while processing onu indication during scale tests
RCA:1) The ONU discovery is successfully completed.
2) As part of the ONU Indication processing , during creating the interface an OMCI test is performed before we start MIB upload process.
3) OMCI requests are sent and while we wait for the response we maintain a timeout.
4) Simultaneously , a delete request for this device has triggered clean
up of the device objects , the ONU indication goroutine wakes up after timeout in a case when the OLT is unable to process the OMCI requests
and acccess an invalid object causing a segmentation fault.
Change-Id: Ifcb64d86854ddb4e2d4857897cc9789128410015
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 33ba76e..db394cb 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -231,6 +231,7 @@
isFlowMonitoringRoutineActive []bool // length of slice equal to number of uni ports
disableDeviceRequested bool // this flag identify ONU received disable request or not
oltAvailable bool
+ deviceDeleteCommChan chan bool
}
// newDeviceHandler creates a new device handler
@@ -283,6 +284,7 @@
ImageState: voltha.ImageState_IMAGE_UNKNOWN,
}
dh.upgradeFsmChan = make(chan struct{})
+ dh.deviceDeleteCommChan = make(chan bool, 2)
if dh.device.PmConfigs != nil { // can happen after onu adapter restart
dh.pmConfigs = cloned.PmConfigs
@@ -2046,6 +2048,9 @@
logger.Warnw(ctx, "omci start-verification timed out (continue normal)", log.Fields{"device-id": dh.DeviceID})
case testresult := <-verifyExec:
logger.Infow(ctx, "Omci start verification done", log.Fields{"device-id": dh.DeviceID, "result": testresult})
+ case <-dh.deviceDeleteCommChan:
+ logger.Warnw(ctx, "Deleting device, stopping the omci test activity", log.Fields{"device-id": dh.DeviceID})
+ return nil
}
/* In py code it looks earlier (on activate ..)