[RICPLT-1852] Supports E2T Initialize + increase number of rmr send retries + logs... 64/864/1
authorrh362j <ronen.hasid@intl.att.com>
Mon, 2 Sep 2019 14:13:25 +0000 (17:13 +0300)
committerrh362j <ronen.hasid@intl.att.com>
Mon, 2 Sep 2019 14:22:06 +0000 (17:22 +0300)
Change-Id: I6e3ae212ddde48a2cb1d94baff2ba5d14b079a21
Signed-off-by: rh362j <ronen.hasid@intl.att.com>
E2Manager/handlers/e2_term_init_notification_handler.go
E2Manager/handlers/ran_lost_connection_handler.go
E2Manager/managers/ran_setup_manager.go
E2Manager/rmrCgo/rmrCgoApi.go

index 7299910..cec0bfc 100644 (file)
@@ -41,8 +41,9 @@ func NewE2TermInitNotificationHandler(ranReconnectionManager *managers.RanReconn
 func (handler E2TermInitNotificationHandler) Handle(logger *logger.Logger, e2Sessions sessions.E2Sessions,
        request *models.NotificationRequest, messageChannel chan<- *models.NotificationResponse) {
 
-       nbIdentityList, err := handler.rnibReaderProvider().GetListNodebIds()
+       logger.Infof("#E2TermInitNotificationHandler.Handle - Handling E2_TERM_INIT")
 
+       nbIdentityList, err := handler.rnibReaderProvider().GetListNodebIds()
        if err != nil {
                logger.Errorf("#E2TermInitNotificationHandler.Handle - Failed to get nodes list from RNIB. Error: %s", err.Error())
                return
@@ -63,5 +64,6 @@ func (handler E2TermInitNotificationHandler) Handle(logger *logger.Logger, e2Ses
                        }
                }
        }
+
        logger.Infof("#E2TermInitNotificationHandler.Handle - Completed handling of E2_TERM_INIT")
 }
index 1da2d12..e899202 100644 (file)
@@ -35,12 +35,7 @@ func NewRanLostConnectionHandler(ranReconnectionManager managers.IRanReconnectio
 }
 func (handler RanLostConnectionHandler) Handle(logger *logger.Logger, e2Sessions sessions.E2Sessions, request *models.NotificationRequest, messageChannel chan<- *models.NotificationResponse) {
 
-       ranName := request.TransactionId
-
-       // TODO: check with E2T dev why does request.RanName (MEID) does not contain the ran name (in case sim is down)
-       if len(request.RanName) > 0 {
-               ranName = request.RanName
-       }
+       ranName := request.RanName
 
        logger.Warnf("#RanLostConnectionHandler.Handle - RAN name: %s - Received lost connection notification", ranName)
 
index a66d4f1..6297467 100644 (file)
@@ -53,7 +53,7 @@ func (m *RanSetupManager) updateConnectionStatusConnecting(nodebInfo *entities.N
        if err != nil {
                m.logger.Errorf("#RanSetupManager.updateConnectionStatusConnecting - Ran name: %s - Failed updating RAN's connection status to CONNECTING : %s", nodebInfo.RanName, err)
        } else {
-               m.logger.Errorf("#RanSetupManager.updateConnectionStatusConnecting - Ran name: %s - Successfully updated rNib. RAN's current connection status: CONNECTING, RAN's current connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionAttempts)
+               m.logger.Infof("#RanSetupManager.updateConnectionStatusConnecting - Ran name: %s - Successfully updated rNib. RAN's current connection status: CONNECTING, RAN's current connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionAttempts)
        }
        return err
 }
@@ -67,7 +67,7 @@ func (m *RanSetupManager) updateConnectionStatusDisconnected(nodebInfo *entities
        if err != nil {
                m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Failed updating RAN's connection status to DISCONNECTED : %s", nodebInfo.RanName, err)
        } else {
-               m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Successfully updated rNib. RAN's current connection status: DISCONNECTED, RAN's current connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionAttempts)
+               m.logger.Infof("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Successfully updated rNib. RAN's current connection status: DISCONNECTED, RAN's current connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionAttempts)
        }
        return err
 }
@@ -85,7 +85,7 @@ func (m *RanSetupManager) prepareSetupRequest(nodebInfo *entities.NodebInfo) (in
                return rmrMsgType, request, nil
        }
 
-       m.logger.Errorf("#RanSetupManager.ExecuteSetup - Unsupported nodebInfo.E2ApplicationProtocol %d ", nodebInfo.E2ApplicationProtocol)
+       m.logger.Errorf("#RanSetupManager.prepareSetupRequest - Unsupported nodebInfo.E2ApplicationProtocol %d ", nodebInfo.E2ApplicationProtocol)
        return 0, nil, e2managererrors.NewInternalError()
 }
 
index 9b242c4..1bac250 100644 (file)
@@ -46,6 +46,10 @@ func (*Context) Init(port string, maxMsgSize int, flags int, logger *logger.Logg
                }
        }
        logger.Infof("#rmrCgoApi.Init - RMR router has been initiated")
+
+       // Configure the rmr to make rounds of attempts to send a message before notifying the application that it should retry.
+       // Each round is about 1000 attempts with a short sleep between each round.
+       C.rmr_set_stimeout(ctx.RmrCtx, C.int(1000))
        r := RmrMessenger(ctx)
        return &r
 }