[VOL-2644]:handle failed scenarios while cleaning up pon resources
on ChildDeviceLost
Change-Id: Ida6d10e8151c8689dd5b3dfc89b3bed9e1f956c3
diff --git a/VERSION b/VERSION
index 80bfff5..b001d23 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.3.12-dev
+2.3.12
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 03391a4..8b01c34 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -1797,30 +1797,30 @@
//clear PON resources associated with ONU
var onuGemData []rsrcMgr.OnuGemInfo
if err := dh.resourceMgr.ResourceMgrs[IntfID].GetOnuGemInfo(ctx, IntfID, &onuGemData); err != nil {
- log.Errorw("Failed-to-get-onu-info-for-pon-port ", log.Fields{
+ log.Warnw("Failed-to-get-onu-info-for-pon-port ", log.Fields{
"device-id": dh.deviceID,
"interface-id": IntfID,
"error": err})
- }
+ } else {
+ for i, onu := range onuGemData {
+ if onu.OnuID == onuID && onu.SerialNumber == onuDevice.(*OnuDevice).serialNumber {
+ log.Debugw("onu-data ", log.Fields{"onu": onu})
+ if err := dh.clearUNIData(ctx, &onu); err != nil {
+ log.Warnw("Failed-to-clear-uni-data-for-onu", log.Fields{
+ "device-id": dh.deviceID,
+ "onu-device": onu,
+ "error": err})
+ }
+ // Clear flowids for gem cache.
+ for _, gem := range onu.GemPorts {
+ dh.resourceMgr.DeleteFlowIDsForGem(ctx, IntfID, gem)
+ }
+ onuGemData = append(onuGemData[:i], onuGemData[i+1:]...)
+ dh.resourceMgr.UpdateOnuGemInfo(ctx, IntfID, onuGemData)
- for i, onu := range onuGemData {
- if onu.OnuID == onuID && onu.SerialNumber == onuDevice.(*OnuDevice).serialNumber {
- log.Debugw("onu-data ", log.Fields{"onu": onu})
- if err := dh.clearUNIData(ctx, &onu); err != nil {
- log.Errorw("Failed-to-clear-uni-data-for-onu", log.Fields{
- "device-id": dh.deviceID,
- "onu-device": onu,
- "error": err})
+ dh.resourceMgr.FreeonuID(ctx, IntfID, []uint32{onu.OnuID})
+ break
}
- // Clear flowids for gem cache.
- for _, gem := range onu.GemPorts {
- dh.resourceMgr.DeleteFlowIDsForGem(ctx, IntfID, gem)
- }
- onuGemData = append(onuGemData[:i], onuGemData[i+1:]...)
- dh.resourceMgr.UpdateOnuGemInfo(ctx, IntfID, onuGemData)
-
- dh.resourceMgr.FreeonuID(ctx, IntfID, []uint32{onu.OnuID})
- break
}
}
dh.onus.Delete(onuKey)