[VOL-3955] Sporadically an ONU does not reach pre-reconciling reason in multiple ONU-scenario
Change-Id: I7d40a894d2f0852e3036fd99bd7d8bb7309df7f0
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index ac04031..9993baa 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -946,10 +946,8 @@
}
}
-func (dh *deviceHandler) reconcileMetrics(ctx context.Context) {
- logger.Debugw(ctx, "reconciling - trigger metrics - to be implemented in scope of VOL-3324!", log.Fields{"device-id": dh.deviceID})
-
- //TODO: reset of reconciling-flag has always to be done in the last reconcile*() function
+func (dh *deviceHandler) reconcileEnd(ctx context.Context) {
+ logger.Debugw(ctx, "reconciling - completed!", log.Fields{"device-id": dh.deviceID})
dh.stopReconciling(ctx)
}
@@ -1965,7 +1963,7 @@
// or even some previous flow add activity on the same port
_ = dh.deviceReasonUpdate(ctx, drOmciFlowsPushed, !dh.isReconciling())
if dh.isReconciling() {
- go dh.reconcileMetrics(ctx)
+ go dh.reconcileEnd(ctx)
}
}
} else {
diff --git a/internal/pkg/onuadaptercore/mib_sync.go b/internal/pkg/onuadaptercore/mib_sync.go
index c4f8d62..9a01ae3 100644
--- a/internal/pkg/onuadaptercore/mib_sync.go
+++ b/internal/pkg/onuadaptercore/mib_sync.go
@@ -245,8 +245,16 @@
} else {
oo.baseDeviceHandler.enableUniPortStateUpdate(ctx)
}
- oo.baseDeviceHandler.stopReconciling(ctx)
go func() {
+ // Stopping reconcilement has to be delayed as in multi-ONU/multi-flow environment
+ // the parallel processing to rebuild the adapter internal flow data could still be
+ // running here. It will take only a few milliseconds until the corresponding threads
+ // will be finished as no OMCI-config is done in this use case.
+ // TODO: The timer approach should be replaced by a more sophisticated solution using
+ // a real interaction between this routine and the threads configuring the flow data
+ // after imminent release VOLTHA v2.7
+ time.Sleep(100 * time.Millisecond)
+ oo.baseDeviceHandler.stopReconciling(ctx)
_ = oo.pMibUploadFsm.pFsm.Event(ulEvSuccess)
}()
diff --git a/internal/pkg/onuadaptercore/omci_vlan_config.go b/internal/pkg/onuadaptercore/omci_vlan_config.go
index 4660e95..5d46208 100644
--- a/internal/pkg/onuadaptercore/omci_vlan_config.go
+++ b/internal/pkg/onuadaptercore/omci_vlan_config.go
@@ -1001,13 +1001,13 @@
}(pConfigVlanStateBaseFsm)
return
}
+ if oFsm.pDeviceHandler.isSkipOnuConfigReconciling() {
+ oFsm.configuredUniFlow = oFsm.numUniFlows
+ logger.Debugw(ctx, "reconciling - skip enterVlanConfigDone processing",
+ log.Fields{"numUniFlows": oFsm.numUniFlows, "configuredUniFlow": oFsm.configuredUniFlow, "device-id": oFsm.deviceID})
+ return
+ }
if oFsm.numUniFlows > oFsm.configuredUniFlow {
- if oFsm.pDeviceHandler.isSkipOnuConfigReconciling() {
- oFsm.configuredUniFlow = oFsm.numUniFlows
- logger.Debugw(ctx, "reconciling - skip enterVlanConfigDone processing",
- log.Fields{"numUniFlows": oFsm.numUniFlows, "configuredUniFlow": oFsm.configuredUniFlow, "device-id": oFsm.deviceID})
- return
- }
if oFsm.configuredUniFlow == 0 {
// this is a restart with a complete new flow, we can re-use the initial flow config control
// including the check, if the related techProfile is (still) available (probably also removed in between)