Added some more checks for E2T create handling and RMR update to v4.8.0 17/7217/2 0.8.2
authorwahidw <abdulwahid.w@nokia.com>
Fri, 3 Dec 2021 10:17:08 +0000 (10:17 +0000)
committerwahidw <abdulwahid.w@nokia.com>
Fri, 3 Dec 2021 12:03:11 +0000 (12:03 +0000)
Change-Id: I153ec1fd4a5a81d29fe01f1bac0e7e667091ec41
Signed-off-by: wahidw <abdulwahid.w@nokia.com>
Dockerfile
RELNOTES
container-tag.yaml
pkg/nbi/control.go
pkg/nbi/httprestful.go
pkg/sbi/nngpush.go

index d479183..6963a30 100644 (file)
@@ -26,7 +26,7 @@
 FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as rtmgrbuild
 
 # Install RMr shared library
-ARG RMRVERSION=4.7.4
+ARG RMRVERSION=4.8.0
 RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb && rm -rf rmr_${RMRVERSION}_amd64.deb
 # Install RMr development header files
 RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb && rm -rf rmr-dev_${RMRVERSION}_amd64.deb
index 8c62e10..d68b57f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,3 +1,6 @@
+### v0.8.2
+* Added some checks for E2tcreate handling and RMR update to v4.8.0 
+
 ### v0.8.1
 * RIC-702: Clean-up logging in routing manager
 
index 2a12ede..2810342 100644 (file)
@@ -2,4 +2,4 @@
 # By default this file is in the docker build directory,
 # but the location can configured in the JJB template.
 ---
-tag: 0.8.1
+tag: 0.8.2
index 98d7821..bd1bf4b 100644 (file)
@@ -244,9 +244,11 @@ func Serve() {
        go updateEp()
        time.Sleep(5 * time.Second)
        sendRoutesToAll()
-       /* Sometimes first message  fails, retry after 5 sec */
-       time.Sleep(5 * time.Second)
-       sendRoutesToAll()
+       for i := 0; i <= 5; i++ {
+               /* Sometimes first message  fails, retry after 5 sec */
+               time.Sleep(10 * time.Second)
+               sendRoutesToAll()
+       }
 
        for {
                xapp.Logger.Debug("Periodic Routes value = %s", xapp.Config.GetString("periodicroutes"))
index 8222e72..794cee9 100644 (file)
@@ -49,6 +49,7 @@ import (
        //"routing-manager/pkg/restapi/operations/handle"
        "routing-manager/pkg/rpe"
        "routing-manager/pkg/rtmgr"
+       "routing-manager/pkg/sbi"
        "routing-manager/pkg/sdl"
        "strconv"
        "strings"
@@ -312,13 +313,18 @@ func CreateNewE2tHandleHandlerImpl(data *models.E2tData) error {
        m.Unlock()
        updateEp()
        //sendPartialRoutesToAll(nil, rtmgr.E2Type)
+       sbi.Conn.Lock()
+       rtmgr.RMRConnStatus[*data.E2TAddress] = false
+       sbi.Conn.Unlock()
+
        sendRoutesToAll()
        time.Sleep(10 * time.Second)
-       for ep, value := range rtmgr.RMRConnStatus {
-               if ep == *data.E2TAddress && value == true {
-                       rtmgr.RMRConnStatus[ep] = false //Reset to false incase of E2t restart scenario
-                       return nil
-               }
+       if rtmgr.RMRConnStatus[*data.E2TAddress] == true {
+               sbi.Conn.Lock()
+               delete(rtmgr.RMRConnStatus, *data.E2TAddress)
+               sbi.Conn.Unlock()
+               xapp.Logger.Debug("RMRConnStatus Map after = %v", rtmgr.RMRConnStatus)
+               return nil
        }
 
        return errors.New("Error while adding new E2T " + *data.E2TAddress)
index 7ba43c5..0d9634e 100644 (file)
@@ -50,7 +50,7 @@ var rmrcallid = 1
 var rmrdynamiccallid = 201
 var addendpointct = 1
 var count int
-var conn sync.Mutex
+var Conn sync.Mutex
 
 type RmrPush struct {
        Sbi
@@ -169,9 +169,9 @@ func (c *RmrPush) send_sync(ep *rtmgr.Endpoint, policies *[]string, call_id int)
                xapp.Logger.Error("Invoked  send_data to try again due to return value : %v", ret)
        }
 
-       conn.Lock()
+       Conn.Lock()
        rtmgr.RMRConnStatus[ep.Uuid] = ret
-       conn.Unlock()
+       Conn.Unlock()
        // Handling per connection .. may be updating global map
 
        //channel <- EPStatus{ep.Uuid, ret}