[VOL-3959] Reconciling on MDS match: Replace timer approach by IPC
Change-Id: I550b212288e6853b6fd1189cf1977dd43a230af0
diff --git a/internal/pkg/onuadaptercore/omci_vlan_config.go b/internal/pkg/onuadaptercore/omci_vlan_config.go
index 9af8e23..45e0944 100644
--- a/internal/pkg/onuadaptercore/omci_vlan_config.go
+++ b/internal/pkg/onuadaptercore/omci_vlan_config.go
@@ -341,12 +341,9 @@
// in any case (even if it might be automatically requested by above cancellation of waiting) ensure resetting the FSM
pAdaptFsm := oFsm.pAdaptFsm
if pAdaptFsm != nil {
- // obviously calling some FSM event here directly does not work - so trying to decouple it ...
- go func(aPAFsm *AdapterFsm) {
- if aPAFsm.pFsm != nil {
- _ = oFsm.pAdaptFsm.pFsm.Event(vlanEvReset)
- }
- }(pAdaptFsm)
+ if pAdaptFsm.pFsm != nil {
+ _ = pAdaptFsm.pFsm.Event(vlanEvReset)
+ }
}
}
@@ -485,9 +482,7 @@
log.Fields{"fsmState": oFsm.pAdaptFsm.pFsm.Current(), "device-id": oFsm.deviceID})
oFsm.mutexFlowParams.Unlock()
if pConfigVlanStateBaseFsm.Is(vlanStConfigDone) {
- go func(a_pBaseFsm *fsm.FSM) {
- _ = a_pBaseFsm.Event(vlanEvSkipOmciConfig)
- }(pConfigVlanStateBaseFsm)
+ _ = pConfigVlanStateBaseFsm.Event(vlanEvSkipOmciConfig)
}
return nil
}
@@ -501,7 +496,6 @@
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)
- // Can't call FSM Event directly, decoupling it
go func(a_pBaseFsm *fsm.FSM) {
_ = a_pBaseFsm.Event(vlanEvRenew)
}(pConfigVlanStateBaseFsm)
@@ -516,7 +510,6 @@
logger.Debugw(ctx, "UniVlanConfigFsm - incremental config request (on setConfig)", log.Fields{
"device-id": oFsm.deviceID, "uni-id": oFsm.pOnuUniPort.uniID,
"set-Vlan": oFsm.actualUniVlanConfigRule.SetVid, "tp-id": tpID, "ProfDone": loTechProfDone})
-
go func(aPBaseFsm *fsm.FSM, aTechProfDone bool) {
if aTechProfDone {
// let the vlan processing continue with next rule
@@ -1003,6 +996,10 @@
}
if oFsm.pDeviceHandler.isSkipOnuConfigReconciling() {
oFsm.configuredUniFlow = oFsm.numUniFlows
+ if !oFsm.pDeviceHandler.isReconcilingFlows() {
+ logger.Debugw(ctx, "reconciling - flow processing finished", log.Fields{"device-id": oFsm.deviceID})
+ oFsm.pDeviceHandler.chReconcilingFlowsFinished <- true
+ }
logger.Debugw(ctx, "reconciling - skip enterVlanConfigDone processing",
log.Fields{"numUniFlows": oFsm.numUniFlows, "configuredUniFlow": oFsm.configuredUniFlow, "device-id": oFsm.deviceID})
return