bug fix 22/8822/1
authorKonstantinos Archangelof <konstantinos.archangelof@nokia.com>
Thu, 21 Jul 2022 09:05:19 +0000 (12:05 +0300)
committerAnssi Mannila <anssi.mannila@nokia.com>
Wed, 3 Aug 2022 07:33:34 +0000 (10:33 +0300)
  * minor bug fix for hanging REST Subscriptions in E2 node down case.

Signed-off-by: Konstantinos Archangelof <konstantinos.archangelof@nokia.com>
Change-Id: Ia7934ef41595fd5ca78e662e4bc0174644d5e714

pkg/control/registry.go

index f9e1bcc..88a4cc5 100644 (file)
@@ -657,15 +657,17 @@ func (r *Registry) DeleteAllE2Subscriptions(ranName string, c *Control) {
 
        // Delete REST subscription from registry and db
        for restSubId, restSubs := range r.restSubscriptions {
-               if restSubs.Meid == ranName && restSubs.SubReqOngoing == true || restSubs.SubDelReqOngoing == true {
-                       // Subscription creation or deletion processes need to be processed gracefully till the end.
-                       // Subscription is deleted at end of the process in both cases.
-                       xapp.Logger.Debug("Registry: REST subscription under prosessing ongoing cannot delete it yet. RestSubId=%v, SubReqOngoing=%v, SubDelReqOngoing=%v", restSubId, restSubs.SubReqOngoing, restSubs.SubDelReqOngoing)
-                       continue
-               } else {
-                       xapp.Logger.Debug("Registry: REST subscription delete. subId=%v", restSubId)
-                       delete(r.restSubscriptions, restSubId)
-                       c.RemoveRESTSubscriptionFromDb(restSubId)
+               if restSubs.Meid == ranName {
+                       if restSubs.SubReqOngoing == true || restSubs.SubDelReqOngoing == true {
+                               // Subscription creation or deletion processes need to be processed gracefully till the end.
+                               // Subscription is deleted at end of the process in both cases.
+                               xapp.Logger.Debug("Registry: REST subscription under prosessing ongoing cannot delete it yet. RestSubId=%v, SubReqOngoing=%v, SubDelReqOngoing=%v", restSubId, restSubs.SubReqOngoing, restSubs.SubDelReqOngoing)
+                               continue
+                       } else {
+                               xapp.Logger.Debug("Registry: REST subscription delete. subId=%v", restSubId)
+                               delete(r.restSubscriptions, restSubId)
+                               c.RemoveRESTSubscriptionFromDb(restSubId)
+                       }
                }
        }
 }