[VOL-5465] Fixes for deadlock in TP download request, flow removal resp when FSM disabled, and tpProcResult entry removal on FSM reset
Signed-off-by: bseeniva <balaji.seenivasan@radisys.com>
Change-Id: Ife1b6f5d0b2147a32a4c2a00fac516e75ec35e0f
diff --git a/internal/pkg/avcfg/omci_vlan_config.go b/internal/pkg/avcfg/omci_vlan_config.go
index bc927c1..9b0b8b9 100755
--- a/internal/pkg/avcfg/omci_vlan_config.go
+++ b/internal/pkg/avcfg/omci_vlan_config.go
@@ -996,8 +996,11 @@
log.Fields{"fsmState": pConfigVlanStateBaseFsm.Current(), "error": fsmErr, "device-id": oFsm.deviceID})
}
oFsm.mutexFlowParams.Lock()
+ return true
} // if not in the appropriate state a new entry will be automatically considered later
// when the configDone state is reached
+ // If the FSM is in Disabled or resetted state, push a response on the flow response channel
+ oFsm.pushReponseOnFlowResponseChannel(ctx, respChan, nil)
return true
}
diff --git a/internal/pkg/avcfg/onu_uni_tp.go b/internal/pkg/avcfg/onu_uni_tp.go
index 0b4a204..a905192 100755
--- a/internal/pkg/avcfg/onu_uni_tp.go
+++ b/internal/pkg/avcfg/onu_uni_tp.go
@@ -290,9 +290,9 @@
log.Fields{"device-id": onuTP.deviceID, "uni-id": aUniID})
onuTP.mutexTPState.Lock()
- defer onuTP.mutexTPState.Unlock()
onuTP.procResult[uniTpKey] = fmt.Errorf("techProfile config aborted: Omci AniSideConfig failed %d on %s",
aUniID, onuTP.deviceID)
+ onuTP.mutexTPState.Unlock()
//this issue here means that the AniConfigFsm has not finished successfully
//which requires to reset it to allow for new usage, e.g. also on a different UNI
//(without that it would be reset on device down indication latest)
@@ -906,7 +906,6 @@
//deleting a map entry should be safe, even if not existing
delete(onuTP.mapUniTpIndication, uniTpKey)
delete(onuTP.mapPonAniConfig, uniTpKey)
- delete(onuTP.procResult, uniTpKey)
delete(onuTP.tpProfileExists, uniTpKey)
delete(onuTP.tpProfileResetting, uniTpKey)
}