X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fmanagers%2Fran_reconnection_manager.go;h=87a656ec3041b2cff9907be763c08498cb91c4e7;hb=refs%2Fchanges%2F85%2F885%2F1;hp=ec521a1cc26bd1919a31a425868d0847f7f2d9fb;hpb=264731981e4a52e876c5b484e35032ada6559ac6;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/managers/ran_reconnection_manager.go b/E2Manager/managers/ran_reconnection_manager.go index ec521a1..87a656e 100644 --- a/E2Manager/managers/ran_reconnection_manager.go +++ b/E2Manager/managers/ran_reconnection_manager.go @@ -57,11 +57,13 @@ func (m *RanReconnectionManager) ReconnectRan(inventoryName string) error { return rnibErr } + m.logger.Infof("#RanReconnectionManager.ReconnectRan - RAN name: %s - RAN's connection status: %s, RAN's connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionStatus, nodebInfo.ConnectionAttempts) + if !m.canReconnectRan(nodebInfo) { - m.logger.Warnf("#RanReconnectionManager.ReconnectRan - RAN name: %s - Cannot reconnect RAN", inventoryName) return m.setConnectionStatusOfUnconnectableRan(nodebInfo) } + err := m.ranSetupManager.ExecuteSetup(nodebInfo) if err != nil { @@ -69,7 +71,6 @@ func (m *RanReconnectionManager) ReconnectRan(inventoryName string) error { return err } - m.logger.Infof("#RanReconnectionManager.ReconnectRan - RAN name: %s - Successfully done executing setup. RAN's connection attempts: %d", inventoryName, nodebInfo.ConnectionAttempts) return nil } @@ -92,20 +93,25 @@ func (m *RanReconnectionManager) updateNodebInfoStatus(nodebInfo *entities.Nodeb return err } - m.logger.Infof("#RanReconnectionManager.updateNodebInfoStatus - RAN name: %s - Successfully updated RAN's connection status to %s in rNib", nodebInfo.RanName, connectionStatus) + m.logger.Infof("#RanReconnectionManager.updateNodebInfoStatus - RAN name: %s - Successfully updated rNib. RAN's current connection status: %s", nodebInfo.RanName, nodebInfo.ConnectionStatus) return nil } func (m *RanReconnectionManager) setConnectionStatusOfUnconnectableRan(nodebInfo *entities.NodebInfo) common.IRNibError { connectionStatus := nodebInfo.GetConnectionStatus() - m.logger.Warnf("#RanReconnectionManager.setConnectionStatusOfUnconnectableRan - RAN name: %s, RAN's connection status: %s, RAN's connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionStatus, nodebInfo.ConnectionAttempts) + + if connectionStatus == entities.ConnectionStatus_SHUT_DOWN { + m.logger.Warnf("#RanReconnectionManager.ReconnectRan - RAN name: %s - Cannot reconnect RAN. Reason: connection status is SHUT_DOWN", nodebInfo.RanName) + return nil + } if connectionStatus == entities.ConnectionStatus_SHUTTING_DOWN { + m.logger.Warnf("#RanReconnectionManager.ReconnectRan - RAN name: %s - Cannot reconnect RAN. Reason: connection status is SHUTTING_DOWN", nodebInfo.RanName) return m.updateNodebInfoStatus(nodebInfo, entities.ConnectionStatus_SHUT_DOWN) } if int(nodebInfo.GetConnectionAttempts()) >= m.config.MaxConnectionAttempts { - m.logger.Warnf("#RanReconnectionManager.setConnectionStatusOfUnconnectableRan - RAN name: %s - RAN's connection attempts are greater than %d", nodebInfo.RanName, m.config.MaxConnectionAttempts) + m.logger.Warnf("#RanReconnectionManager.ReconnectRan - RAN name: %s - Cannot reconnect RAN. Reason: RAN's connection attempts exceeded the limit (%d)", nodebInfo.RanName, m.config.MaxConnectionAttempts) return m.updateNodebInfoStatus(nodebInfo, entities.ConnectionStatus_DISCONNECTED) }