[VOL-3948] Sporadically an ONU remains in device list after deletion in multiple ONU-scenario
Change-Id: I9f120ee9062c67e9ae7dadfa75746fa0389ab566
diff --git a/VERSION b/VERSION
index 08a1262..aa59c75 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.7-dev188
+1.2.7-dev189
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index 9993baa..817a147 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -810,7 +810,9 @@
pDevEntry := dh.getOnuDeviceEntry(ctx, true)
if pDevEntry == nil {
logger.Errorw(ctx, "No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
dh.pOnuTP.lockTpProcMutex()
@@ -821,7 +823,9 @@
if len(pDevEntry.sOnuPersistentData.PersUniConfig) == 0 {
logger.Debugw(ctx, "reconciling - no uni-configs have been stored before adapter restart - terminate reconcilement",
log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
techProfsFound := false
@@ -856,7 +860,9 @@
if !techProfsFound {
logger.Debugw(ctx, "reconciling - no TPs have been stored before adapter restart - terminate reconcilement",
log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
if dh.isSkipOnuConfigReconciling() {
@@ -865,7 +871,9 @@
if !flowsFound {
logger.Debugw(ctx, "reconciling - no flows have been stored before adapter restart - terminate reconcilement",
log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
}
}
@@ -875,7 +883,9 @@
pDevEntry := dh.getOnuDeviceEntry(ctx, true)
if pDevEntry == nil {
logger.Errorw(ctx, "No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
pDevEntry.persUniConfigMutex.RLock()
@@ -884,7 +894,9 @@
if len(pDevEntry.sOnuPersistentData.PersUniConfig) == 0 {
logger.Debugw(ctx, "reconciling - no uni-configs have been stored before adapter restart - terminate reconcilement",
log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
flowsFound := false
@@ -898,6 +910,8 @@
if len(uniData.PersTpPathMap) == 0 {
logger.Warnw(ctx, "reconciling - flows but no TPs stored for uniID",
log.Fields{"uni-id": uniData.PersUniID, "device-id": dh.deviceID})
+ // It doesn't make sense to configure any flows if no TPs are available
+ continue
}
var uniPort *onuUniPort
var exist bool
@@ -905,7 +919,9 @@
if uniPort, exist = dh.uniEntityMap[uniNo]; !exist {
logger.Errorw(ctx, "reconciling - onuUniPort data not found - terminate reconcilement",
log.Fields{"uniNo": uniNo, "device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
flowsFound = true
@@ -938,7 +954,9 @@
if !flowsFound {
logger.Debugw(ctx, "reconciling - no flows have been stored before adapter restart - terminate reconcilement",
log.Fields{"device-id": dh.deviceID})
- dh.stopReconciling(ctx)
+ if !dh.isSkipOnuConfigReconciling() {
+ dh.stopReconciling(ctx)
+ }
return
}
if dh.isSkipOnuConfigReconciling() {
diff --git a/internal/pkg/onuadaptercore/mib_sync.go b/internal/pkg/onuadaptercore/mib_sync.go
index 9a01ae3..8aabeb7 100644
--- a/internal/pkg/onuadaptercore/mib_sync.go
+++ b/internal/pkg/onuadaptercore/mib_sync.go
@@ -235,10 +235,8 @@
// no need to reconcile additional data for MibDownloadFsm, LockStateFsm, or UnlockStateFsm
oo.baseDeviceHandler.reconcileDeviceTechProf(ctx)
- if oo.baseDeviceHandler.isReconciling() {
- oo.baseDeviceHandler.reconcileDeviceFlowConfig(ctx)
- }
- // set admin state independent of reconciling state after tp/flow reconcilement
+ oo.baseDeviceHandler.reconcileDeviceFlowConfig(ctx)
+
if oo.sOnuPersistentData.PersUniDisableDone {
oo.baseDeviceHandler.disableUniPortStateUpdate(ctx)
oo.baseDeviceHandler.setDeviceReason(drOmciAdminLock)