VOL-5260:Intermittently ONT gets stuck at Discovery state and cannot be deleted.
Change-Id: Ic2b651ef2725065359b67532e66e97bacd0db904
Signed-off-by: Praneeth Nalmas <praneeth.nalmas@radisys.com>
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index c5e03c4..e2dfad7 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -2239,9 +2239,12 @@
logger.Debugw(ctx, "resetFsms entered", log.Fields{"device-id": dh.DeviceID})
pDevEntry := dh.GetOnuDeviceEntry(ctx, false)
+ //VOL-5260: During race conditions when adoptDevice has not yet completed
+ // and deleteDevice is issued , returning error will further prevent clean up
+ // at rwcore . Returning success for clean up to happen and discovery to happen again.
if pDevEntry == nil {
logger.Errorw(ctx, "No valid OnuDevice -aborting", log.Fields{"device-id": dh.DeviceID})
- return fmt.Errorf("no valid OnuDevice: %s", dh.DeviceID)
+ return nil
}
if pDevEntry.PDevOmciCC != nil {
pDevEntry.PDevOmciCC.CancelRequestMonitoring(ctx)