From 0fd0692ced4f1368c667bbd60340390318f44d49 Mon Sep 17 00:00:00 2001 From: dhirajverma Date: Tue, 7 Dec 2021 05:40:08 -0500 Subject: [PATCH] E2T stop issue with reassoc Change-Id: I05d0c3b03ec3d0d8493a675a092f164a30da0f8f Signed-off-by: dhirajverma --- .../e2_term_init_notification_handler.go | 39 ++++++++++++++++++---- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/E2Manager/handlers/rmrmsghandlers/e2_term_init_notification_handler.go b/E2Manager/handlers/rmrmsghandlers/e2_term_init_notification_handler.go index d11158b..ef9b779 100644 --- a/E2Manager/handlers/rmrmsghandlers/e2_term_init_notification_handler.go +++ b/E2Manager/handlers/rmrmsghandlers/e2_term_init_notification_handler.go @@ -79,6 +79,7 @@ func (h E2TermInitNotificationHandler) Handle(request *models.NotificationReques if len(e2tInstance.AssociatedRanList) == 0 { h.logger.Infof("#E2TermInitNotificationHandler.Handle - E2T Address: %s - E2T instance has no associated RANs", e2tInstance.Address) + //h.UpdateExistingE2TInstanceToRtmgr(e2tAddress) return } @@ -106,12 +107,38 @@ func (h E2TermInitNotificationHandler) HandleExistingE2TInstance(e2tInstance *en func (h E2TermInitNotificationHandler) HandleNewE2TInstance(e2tAddress string, podName string) { - err := h.routingManagerClient.AddE2TInstance(e2tAddress) + for i := 1; i < 4; i++ { - if err != nil { - h.logger.Errorf("#E2TermInitNotificationHandler.HandleNewE2TInstance - e2t address: %s - routing manager failure", e2tAddress) - return - } + err := h.routingManagerClient.AddE2TInstance(e2tAddress) + + if err == nil{ + + _ = h.e2tInstancesManager.AddE2TInstance(e2tAddress, podName) + + break + } else { + + h.logger.Errorf("#E2TermInitNotificationHandler.HandleNewE2TInstance - e2t address count - %d : %s - routing manager failure", i, e2tAddress) + } + + } +} + +func (h E2TermInitNotificationHandler) UpdateExistingE2TInstanceToRtmgr(e2tAddress string) { + + for i := 1; i < 4; i++ { + + err := h.routingManagerClient.AddE2TInstance(e2tAddress) + + if err == nil{ + break + } else { + + h.logger.Errorf("#E2TermInitNotificationHandler.UpdateExistingE2TInstanceToRtmgr - e2t address count - %d : %s - routing manager failure", i, e2tAddress) + _ = h.e2tInstancesManager.ResetKeepAliveTimestamp(e2tAddress) + } + + } - _ = h.e2tInstancesManager.AddE2TInstance(e2tAddress, podName) } + -- 2.16.6